[Chosen] [Chosen] How to get selected values

Forge Component
(21)
Published on 2018-04-30 by Jogait
21 votes
Published on 2018-04-30 by Jogait

Hi,

The Chosen Module looks really great. I am trying to use it as a filter on a dashboard. But I just can't get the selected values in the OnChange ScreenAction. Am I missing something?

How do I get the selected values in Outsystems?

Solution

Hi Jeroen,

You keep using the combo box and list box the same way as before. So you have the variable where the value is stored or the list, in the case of multi-select list.
In an OnChange you have to see those variables/list.

Can you show a small test where you can demonstrate that you are not able to see the variables/list that stores the result?

Cheers,
Eduardo Jauch

Solution

Thanks for your answer.

Apparently the values wont show up in the debugger :(.
You need to put them in a variable to see them.

Hi Jeroen,

Most of the time, this is due optimization.
If the compiler think you are not using the variables, they are not sent, and than the debugger shows them as if they were empty.

Cheers,
Eduardo Jauch

Hello, I know this has kind of been solved.

I have a chosen attached to a list box. The list box is a list of names with a boolean attribute to it called IsSelected. I want to access the selected names that the user chose and use it for something. Where can I find them? I thought the boolean would automatically change once I selected it, but it did not. What to do?

Hi Vinicius,

Please, read my comment about the optimization of the list. If you are not "using" the list of the ListBox, it will be optimized and no selection will be kept when sending to the server.

Cheers.