Populate a dropdown dynamically

0
I have the following use case for a native app:  A user can add new values in ‘category’ and ‘appliance’ and against each category, a user can have multiple ‘appliances’. In the ‘loadsheet’, both the fields (category and appliance) will be read from their respective entities and will fill up a dropdown, from which a user can take a pick. And these values can be independently stored in the loadsheet as string against the respective attributes.    I thought to make the attributes ‘category’ and ‘appliance’ enumerations, however, I don’t think it’s possible to generate enum values based on user input at runtime.  What could be the way around this problem??  I am using Mendix 9.0.5.   
asked
6 answers
0

Just set association from LoadSheet to Appliance and category. Make sure they both have XPath selected for selectable object datasource. Then you can constrain the appliance reference selector on your page so it only shows appliances for the selected category.

https://docs.mendix.com/refguide/reference-selector

answered
0

Hi Faiqa Ejaz,

make LoadSheet and Appliance (1 - *) Association also  LoadSheet and Category (1 – *) Association

the in the data view connect LoadSheet as entity you will get a  dropdown bar for Appliance and Category 

 

answered
0

 

Here you go.

answered
0

Here is my domain model.  

answered
0

@Faiqa Ejaz, Here is the solution

 

First of all create a entity appliance and category in which the attributes will of string type. after that create loadsheet entity in which take the two attributes appliance and category. while taking aatributes in loadsheet make sure you you dont add attributes but just double click on the the loadsheet entity and click on association tab. here you click on new and select category and again click new and select appliance. Now by using a data view create two fields one is to add items in the compliance list and configure that item with appliance entity and another is to add items in category entity. After that create a button on which call a microflow, here you must create a object of both the entities and place a activity open a page where pass the object you just created. and here your work is done..

If you find my explanation useful please feedback. if any question, feel free to ask.

 

answered
0

XPath constraint: 

 NativeMobile.LoadSheet_Category/NativeMobile.Category/NativeMobile.Appliance_Category/NativeMobile.Appliance

answered