[Multiple Selection Dropdown Widget (Reactive And Mobile)] Is it possible to fetch data from db and marked as selected
Application Type
Reactive

Hi there,

Please may I know whether it is possible to fetch data from database and marked as selected? Thanks!

Solution

Hi Diyab,

If I understand the question correctly, you want to pre-select some items in the list.
(i.e those items should already be selected when the dropdown menu appears on the screen)

Yes, you can do this.

Regardless of how you generate the list,
you need to set IsSelected=True for each item you want to appear pre-selected.


I have added an example screen to the demo showing a dropdown menu using a pre-selected list.
You can download the demo application with the component application from the Forge,
or see it in action here (or click the Try Now button on the Forge).


In the example I added a calculated attribute IsFirstLetterSorN to the GetOffices Aggregate.
IsFirstLetterSorN=True when the first letter of the city name is 's' or 'n' (otherwise it's False).


Now when the screen first loads, the dropdown menu appears like this:


I think this most closely matches what you were asking?

I hope this helps you! :)

Best Regards,

Chris

Hi Diyab,

You can pass the list fetched from database to the dropdown list. Try the demo..

Thanks, Aadhavan S

Solution

Hi Diyab,

If I understand the question correctly, you want to pre-select some items in the list.
(i.e those items should already be selected when the dropdown menu appears on the screen)

Yes, you can do this.

Regardless of how you generate the list,
you need to set IsSelected=True for each item you want to appear pre-selected.


I have added an example screen to the demo showing a dropdown menu using a pre-selected list.
You can download the demo application with the component application from the Forge,
or see it in action here (or click the Try Now button on the Forge).


In the example I added a calculated attribute IsFirstLetterSorN to the GetOffices Aggregate.
IsFirstLetterSorN=True when the first letter of the city name is 's' or 'n' (otherwise it's False).


Now when the screen first loads, the dropdown menu appears like this:


I think this most closely matches what you were asking?

I hope this helps you! :)

Best Regards,

Chris

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.