Showing 2 attribute from the same entity in a Reference Selector?

Hi, I have an app where users can make a case, then manually associate it with another entity which defines the case type. This is its' own entity so that admins can flexibly add case types using a data grid in the future.   The case types have a 'description' and an 'acronym' as well as some other nondescript bits of data. Problem is, when selecting one of the rows from this entity to associate to, description or acronym on it's own don't really tell the user what they're selecting   Is there a way for a reference selector to display 2 of the attributes it is selecting the object of, in the dropdown field it is rendered in?   Failing that, does anyone know of a widget that does this?   Cheers all Luke
3 answers

You can use the AutoComleteForMendix widget to show multiple attributes in the results of the dropdown



Hi Luke,

An easy way to do this which stays close to native Mendix is to simply store both values 'Description' and 'Acronym' in a CaseTypeDisplayString in the entity CaseType, which is updated in a Before Commit event on CaseType. Could be as simple as {Description} / {Acronym}.


Then, in the NewEdit form for Case, you display the CaseTypeDisplayString in the reference selector for selecting your CaseType.


Kind regards,


To my knowledge there is no such widget. The way I solved this is by showing two reference selectors. Not ideal but workable.