I am glad I found this post, but a little frustrated that it took several searches and a couple of hours of trial and error along with research to finally uncover it. I would strongly recommend that you put a note in the core documentation of List Box widgets that the only way to make them work as expected is to use a local variable in between the aggregate and the list box. And include a link to the documentation for how to make a hybrid local variable that includes an entity along with a single new field (the Boolean value for the selection attribute).
The links from Nelson Baptista are no longer active... And I need help using the listbox with multiple selection...
I am using the following local variable to store the options for the listbox:
And I'm using it like this:
But it does not change the boolean value to true, when I have my options selected... What am I doing wrong?
Hi Clara,
The Source Record List is only used *to initialise* the Listbox's internal List runtime property (in your case accessible via ComboMultiplosAgentes.List).
My guess is you are checking the UserAgente contents instead of the ComboMultiplosAgentes.List.
I was able to detect the selected item by binding to a local variable as suggested. However, if you reload your list data inside of an AJAX submit (and update your local variable and call an Ajax Refresh on the listbox) then you can no longer detect the selected item. The boolean value is never set to true when iterating through the MyListBox.List list and I know the loop is correct because it works as expected before it is reloaded inside of an AJAX submit.
In my case I have a button on the page that inserts a new record then reloads the list box. The list box reloads as expected and the new record is in the list but you can't detect the selected item afterwards.
Hi Roy,
if you Ajax Refresh your MyListBox, it's List property will be reinitialized with the data fetched from the Source Record List, so any selections will be lost, unless you also store them in the database, or somehow keep track of them on your screen action logic.