How can I create a dropdown out of string inputs?

3
I want to create a dropdown box that is filled with user inputs. E.g: A user can capture the details of an event. A different user would then be able to select that event from a dropdown of all events to see details etc. Since the corresponding field is not of type ENUM but STRING it won't allow to connect to a drop down box. Is there a smart way to achieve this?
asked
1 answers
6

You can easily connect a dropdown with string inputs. Create an entity with a string attribute and associate this with the entity of the dataview. Now you use a reference selector as a dropdown. You only have to create a datagrid with a dataview to add/edit the dropdown values.

Edit: I've created an example for you. Let's say I have an entity locations and one called events. An event is associated with a location. You can create an entity in the domain model of your module. Right-click in your domain model and click add entity:

domain model

After doing that, you can create a form with a dataview with entity location. Because you've associated location to event you can now add a reference selector to your location dataview. This dropdown is filled with events in your database. You could create a nested dataview right beneath to show the details of the chosen event. See my example:

alt text

The user is only allowed to select the EXISTING events and after selecting, the details will be filled in the nested dataview Location_Event/Event.

Now you can create another form with a datagrid with the entity events and add a new/edit form to create/edit events. You could configure in your application that user1 can only see locations and user 2 can create/edit locations AND events. Result:

Result

answered