Custom caption for enum

0
Hi, Suppose I have a multi-tenant application where I have an enum field somewhere. What I would like to happen is that for different tenants, a different caption is displayed to the user for the different values of the enum. The solutions I can come up with are:  - Make the caption a uuid, and use a javascript snippet that replaces this guid with the desired caption. This makes me unhappy because it is hacky and ridiculous.  - Do not use an enum, use a reference selector to a new entity. This makes my users unhappy because they like selecting via a radiobutton here and not a dropdown list.  - Make a custom widget to handle this. This makes my PO slightly unhappy because it takes a lot of time, my tester unhappy because it will need to be tested thoroughly and my future team members unhappy because they will need to maintain a custom widget. Are there any solutions I did not consider?
asked
4 answers
2

Create a language for each tenant, this is what I did to create a multi tenant application with one tenant requiring a formal tone and one requiring an informal tone, while both tenants used the Dutch language.

answered
0

We use a hybrid sollution. We do create a seperate table. In the table we have the enumeration and we have a calculated field with the translation (see forum post about translatable data). This way each client can have it's own set and it is translatable to other languages and we can still use the enum for conditional visibiltiy etc.

Regards,

Ronald

 

answered
0

I encountered this with multiple clients before.  We created a separate List of Values (LoV) module for this with 4 entities:

  1. LoVType: the type of the enum
  2. LoVValue: the values for that enum;
  3. LoVTranslation: the translation for each LoVValue. a calculated attribute based on the user language;
  4. LoVCondition: can be used to create parent child relations for cascading LoV. Associated LoVValues to other LoVValues.

 

The normal business attributes would then be associated to an LoVValue, which is restricted by the above setup. 

answered
0

Hi Nikel,

As discussed outside of this forum there is a way of making your second scenario work, and since other people may face similar problems I'll post it here as well:

for your 'Do not use an enum, use a reference selector to a new entity. This makes my users unhappy because they like selecting via a radiobutton here and not a dropdown list' option there is a way to keep them happy, that way being the (platform supported) widget Radiobutton List. It lets you easily display and select references using radio buttons.

https://appstore.home.mendix.com/link/app/20/

answered