Country List Dropdown

1
How can I make list of countries in dropdown menu? I've tried to connect dropdown menu (in data view) with an attribute which I set as Enum, but its not worked.
asked
5 answers
7

In the Mendix Business Modeler, an enumerated type (also called enumeration or enum) is a data type that consists of a set of elements, members or enumerators. This set is defined and the enumerator can only take the form of the elements within the set. A good example of an enumerator is 'Country'. Let's say the country of a customer can only be 'Viet Nam', 'Indonesia' and 'The Netherlands'. This means that the attribute 'Country' can only take these three forms. However, there is an additional option for the enumerator to be 'empty' for the special case in which the enumerator was not specified.

An enumeration is a self defined range of String values that will be selectable for an attribute. An image can be defined for every value. For the 'Country' enumeration you can use flags images which can be uploaded at images in the project explorer.

Note: If the property 'Type' is set to 'Enumeration', then this enumeration must be specified. This means that the elements of the enumeration have to be defined by the user. (In the example from above this would be 'Viet Nam', 'Indonesia' and 'The Netherlands', which have to be specified.)

Then you only have to drag the enumeration from the connector into the preferred cell of your dataview.

Pretty easy I would say....

answered
3

Its solved already. Basically I shouldn't called a dataview form from navigation. When I called that form (dataview) from a 'New' button in datagrid, my problem was gone. And since I'm using version 2.4.0, it seems that my previous action has not been yet supported. It seemed that the system cannot understand my action without putting a context first (create or edit object for example).

answered
2

in the new 2.4.3 release it is possible to link microflows to your navigation, letting you supply the form with the context you want. This should make it work the way you initially wanted it.

In 2.4.0 you will still have to use the datagrid first though.

answered
1

I just tested this and this is working fine for me. Is the enum filled? What exactly doesn't work? Does the list stay empty? Does the project not launch?

answered
0

The enum is already filled. It stays empty when I try running the form.

This is exactly how I did it: 1. I've made an attribute called 'Country' in an object called 'Profile' and set the type as Enum 2. I filled-in the Enumeration with 3 countries 3. I put a dropdown list into my DataView and connected it to 'Country' attribute 4. When I run the project, it showed that no options available in the dropdown list.

answered