Dynamic dropdown values

Hi all Mendix GURUs. Is there any chance to have dynamic values in dropdown which uses enumeration? I know the option to have for example three rows and make it visible according to some value. But problem is then that I need to create three enums (first with one value, second with two values, third with three values) but on the entity attribute I can have only one enumeration. second problem is that I havent that attribute which tells me according on its value show this row. Any ideas? For example some special dropdown from AppStore? Thanks, Lukas
3 answers

No there currently is no way to constrain a enumeration. What you could do is create an object that has the enumeration value and constraint that object based on some Business rules.

Because you are able to constrain objects the dropdown will be kind of dynamic. However this is not less work then the alternative you already provided.


When I started working in Mendix I tended to put everything and its mother in Enums when and where possible.

After delivering 3 application for production I now find that I use Enums strictly for those selection-sets that are pretty much no-brainers, but that for anything slightly more complicated then "gender", I prefer to create a module with "basic" tables and use those to provide the content of a dropdown.

The pro┬┤s for this approach

  • security-wise the end-user never has to see these, but you can always create a user-role to give them (limited) access
  • flexibility in values, should you need to add values, go ahead, no need to redeploy
  • flexibility in presentation, use them in dropdowns, selectionscreens etc. with or without constraints

The cons

  • you will need to create the objects in a domainmodel and create appropriate screens to go with them............

As a work-around, the Slider widget on the App Store can ignore selected enumeration values. Do note that this is not dynamic and only client-side though.