Silverstripe custom display rules—how to use the value of a select? - silverstripe

I'm trying to have a select field, and when I select an option, I want a second select box to appear.
The problem is that select fields don't have a value like text fields do. So, any comparison SS provides will fail—always thinking the select field is ''.
Is there any way to compare the value of a select field?

Use display-logic
Disclaimer: I'm the author

Use DependentDropdownFields, I found it easier for dropdowns than Display Logic for this case. (Sorry UncleCheese)

Related

SQL Custom filter in Metabase not show custom field with use [[ ]] to

I'm trying build a custom filter based on a string field. In my case I try map a field "nome_setor" in other table. If I try use variable with a text field works fine:
If I change this for a custom field using another table not works. In this case not show the filter:
Thank you in advance.
You can't use custom fields when you compare it values with some other column.
For you case to work, remove the table alias from the custom field you gonna use, and define your conditional snippet like so:
[[AND {{hithere}}]]
Now when you select the custom field, it should work. But you LIKE won't.
Hope it helps

Calculated_SQL Table - Search

i have done a calculated sql with a custom query.
Implemented a table from that data model.
Until here we are ok.
My problem is the next step:
In my custom query i have a field concatAll(that is all fields concatenated).
In my page i want to put a search box to do a "contains" search in my field concatAll and present those results in my table.
Anyone knows how to do this?
Tried multiple approaches, but could not have the result.
Thanks
As #Pavel Shkleinik send to me this is possible using :params in the query of calculated_sql.
Example:
or (c.phone like concat(CONCAT("%", ifnull(:concatAll,''), "%")))
and you put concatAll as a string parameter on datasource page.
Regards

Drupal 8 select list first as default value

Please, I want to know if there's a simple way in Drupal 8 to make a select list first value always as default value and delete "Select a value" line.
Thank you very much
This can be easily done by adding a List(text) field. After adding the values to your select list choose a default value from that select list as shown in the image below.
Default value for select list
Under Manage Form Display choose select list. This should display the default value set and not 'Select a Value'. Hope this help.

SSRS SELECT ALL emulation in ASP.NET Dropdown List

I have a multi-value parameter for SSRS report.
This parameter being a multi-select will have SELECT ALL option that selects all values under the drop down list.
Challenge is emulating the same using ASP.NET drop down list as parameter source. I will use reportviewer control just to render and display report but not to show parameters. Parameters come from ASP.NET page. How do I achieve SELECT ALL functionality in this case?
You can achieve this in query to retrieve dummy record and do UNION.
Just do a very simple thing showed below.
Select 0 as ID, "(Show All)" as Name
Union
Select Id, Name from MyTable
You could use a jquery widget to do something like this. For example see Eric Hynds jQuery UI Mutliselect:
http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/
It has a 'select all' option

Conditional fields and views

I have five multigroup fields each one are displayed by a conditional field with a 1 to 5 value. If I select for example 2 there's a select list field appearing with is selected data , if i select 1 there's another one with an another select data.
How do I display with wiews only the content of the choosen value of the conditional field.
Thank you.
The simplest way of doing this, would be to create the logic in your theme. There are many ways of doing this, one would be to add all of the possible fields, but exclude them from display, and only show the conditional field. In one of the preprocess functions for the view, you could check the raw data for the conditional field, and replace either the field, or just the the themed value, with the value of the field you want to display.

Resources