How to show a dropdown from Dropdownselector widget containing individual values?

0
Hi, I want to create a dropdown through dropdownselector widget and the dropdown will consists of list of states and each states has its own value. For example - 'Arizon' is the state name which has value as 'Az'. This value I want to retrieve when user selects the particular state name (example-Arizon) from the dropdown.  I am not able to try this with reference selector. please help. Thanks in advance.
asked
3 answers
2

Hi,

Binding data in pages is explained in this online learning module: https://gettingstarted.mendixcloud.com/link/module/5/lecture/65

Related to this I advise you to take this module first: https://gettingstarted.mendixcloud.com/link/module/4/lecture/172

And maybe the whole rapid developer path would be a great start as well.

answered
1

Hi,

You can create an enumeration with all the states (abbreviation + full name).

In your domain model you should have an entity with an attribute of type enumeration that points to the enumeration with states. Now you can put a dropdown widget on your page that allows you to choose a state. 

Grt. Arjan

answered
1

Kavya,

I'm not completely sure what the use case is where States are related to a user account or you need a user to select an option which drives logic in a microflow that you are about to trigger. In both cases, you can setup a table called "States" with as many attributes as you want, and either an association to the account table or an association to a non persistent entity to hold the user selection. I usually use name and abbreviation, and Name being an enumeration with all the US state names. In you application you can create an administration table to create how many ever state objects that you need. Now on your page you can use a reference selector to the states table and allow a user to select whatever option that they want. 

 

Please refer to the screenshot below

Scenario 1 - Association to an Account

 

Scenario 2 - An association to a non persistent

 

answered