Or as work-around solution (not recommended), to fill it with Custom values, but for dataprovider-display value pairs (dataprovider differs from display value) need to have sg like: 13 | i18n:message.key
When valuelist is filled with i18n:message.key and displayTag is checked -it works as expected; but dataprovider is same as text value for i18n:message.key;
displayTag check doesn’t work when i18n keys are read from DB
Tokajac:
Or as work-around solution (not recommended), to fill it with Custom values, but for dataprovider-display value pairs (dataprovider differs from display value) need to have sg like: 13 | i18n:message.key
Why not recommended filling it with custom values . I only work like this:
var _query = 'SELECT country_id, isnull(TR.description, country_code) FROM country \
LEFT OUTER JOIN translations TR ON TR.entity_id = country_id AND TR.entity_type = ? AND TR.language_code = ? \
ORDER BY TR.description';
var _ds = databaseManager.getDataSetByQuery('myServer', _query, [globals.entity_type_country, globals.language_code_user], -1)
var _id_array = _ds.getColumnAsArray(1)
var _desc_array = _ds.getColumnAsArray(2)
application.setValueListItems( 'countrynames', _desc_array, _id_array);
This works fine and the performance is well too.
Just in my framework I’ll load this valuelist if not loaded, or when the contents of the country table was changed.
This too avoid that there are a lot of queries are fired to the database
So if you have simple valuelists, then use the 13 | i18n:message.key like described above.
If you want to create a valuelist based on dynamic values and translations (using your own translation table), then do it like the above sample.
As extension to valuelist_name approach:
I put simple calculation clc_field_value_i18n that returns i18n.getI18NMessage( field_value ) where field_value is column that contains message.key
and clipped it in show in field list of the valuelist
But in browser get exception on the that label: NOTFOUND@Mozilla…
Why it doesn’t display message value from i18n table?
Also, got on my mind to create relation between combo_values and i18n tables?