how to populate a dropdown with a list of items which can be selected

0
Hi how can we populate a dropdown with a list dynamically whose values can be selected and populated on the dropdown when selected
asked
2 answers
3

Hello Aishwarya,

That's doable through reference selectors. You'll have to build a second entity , linked to your first (many to one association) with a string or enum attribute which would contain your dynamic selection. 

Then you would create objects of the second entity for each dynamic entry, and link that entity's string in a reference selector.

Hope this helps.

answered
0

Hi Aishwarya,

  If I understand correctly, you would like to have two dropdowns: when you select a value in the first one the values available for selection in the second drop down change dynamically.  Is that correct?  That is possible in Mendix. In the properties menu for a 'Reference Selector' widget there is a tab called 'Selectable Objects.' In this tab, you can add constraints that will change what objects are available for selection.  You could write a microflow that will retrieve only the objects you want based on the value of the first reference selector.  You could also use XPath to achieve a similar result.  On your first reference selector, have an on-change event that will refresh the entity so the microflow/XPaths will re-run.

  

answered