Allowing empty value should be optional for reference selector - Mendix Forum

Allowing empty value should be optional for reference selector

5

At this moment, a user is always allowed to select empty as a value for a reference selector. This behaviour should be a setting as part of the reference selector configuration where it is either alllowed or not allowed for a user to select empty as a value.

In a lot of cases I have run into, empty is not a valid value that a user should be able to select. I currently have no user friendly way of enforcing this.

asked
1 answers

Nikel - I have thought about this and I am not sure it is practical.  In the case of a new object, what would the reference be set to, the first object retrieved from the associated entity?  It seems this idea requires that the associated entity to have at least one object in it, however, you can't ensure that's the case until runtime, so there is always the potential for a model with inconsistencies at runtime.  As far as how to do this, in your model, you could create objects via microflow and set the association in this create microflow.  Then on your edit page, you could require a value for the reference selector or have an onchange microflow that checks to ensure that the association is not empty.

Created