Combo box selection

Combo box selection

  

Hi,

I am new to outsystem and trying to get used to this new system. 

I have combo box that allow users to select the different kind of category such as electronics, book or movies. I would like to have a selection "All" to display all the different kind of category, how can i do it?

Hi Jac,

It can be done by different way, What i suggest is use Special List properties of combo box where under option you give selection as  "ALL" and once user will select All then programmatically you can handle it.


Thanks

-HM- 

Hi Jac,

As Hitesh suggested, you add an option for "ALL" in your combo box and handle it, however i am little confused by your statement 

"All" to display all the different kind of category


If you could provide the next step on how you want to use the All option further like are you going to next screen and doing some operation using this parameter or refreshing something on the same screen?


Shashank...

Solution

Hello, 

I would like to point you in the direction of the documentation about the combo box:

https://success.outsystems.com/Documentation/10/Reference/Web_Interfaces/Designing_Screens/Combo_Box_Widget

And here shows you how to "order" the items in the combo box:

https://success.outsystems.com/Documentation/Development_FAQs/How_to_order_and_set_the_default_value_in_a_combo_box

Regarding the Special Values mentioned by Hitesh and Shashank, you use it this way:

First, define a special variable. Add the option and its value like option "All" and value 0.
If you will not have any other "special values", you don't need to add the special variable (see the combo box properties in the preparation).

If the user SELECTS the special option, the variable associated with the normal option, usually an identifier for an entity or an aggregate, it will be set to NullIdentifier() or the default value of the variable data type if it is another type.

So, if you want to filter an aggregate by the options, but not filter in case of the "All" is selected, all you have to do, in the filter of the aggregate, is this:

(Session.SelectedId = NullIdentifier OR Entity.TypeId = Session.SelectedId)

Where Session.SelectedId is the variable associated with the combo box (Variable property), and Entity.TypeId is the field of the entity that stores the ID you are selecting in the combo box.

If you select "All", the variable (Session.SelectedId) will be set to NullIdentifier and the filter will be (True OR anything) that will always be TRUE, not filtering the entity results. If you select any other normal options, Session.SelectedId will be different than NullIdentifier() and than only the records that match the Session.SelectedId will be selected.

Hope this helps :)

Cheers,
Eduardo Jauch

Solution