Application Properties editor doesn't seem to use message bundle for Enums

Our app has numerous app properties that are Enums. All the proper keys to produce friendly names are in the message bundle, but the app properties editor seems to not use the bundle for enums?

image

image

Note - message bundle values not used.

Is there a fix for this?

Hi,

Unfortunately, can’t reproduce the issue.
What version of the Jmix plugin are you using? Could you please attach a sample project that reproduce the problem?

Fair enough - here.
apppropenumtest.zip (82.3 KB)

Just run the app, go into admin menu, application properties, pick the medflex.edi ones, that are based on Enums. (PayerIDRequired, EDIProductionOrTest, EDIDoNextInsurance.) Notice that the choices are the raw names, not the values from the message bundle.

Hi,
You are using a configuration file from a CUBA plugin. To ensure proper operation, recommend to use the jmix addon Application Settings

Regards,
Tatiana

Yes, this is a migrated CUBA Application. We need this to work properly.

Hi Jon,
The Application Properties screen in Jmix works in the same way as in CUBA, it shows raw non-localized values of enums.
So after so many years and no complains we consider it a feature.

Regards,
Konstantin

LOL fair enough. Any advice as to how I could “fix” it?

You can override the property edit screen of the framework.

Note that the below approach works only for CUBA screens with the old screen API.

  • Create a new XML descriptor extending appproperties-edit.xml:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
            xmlns:ext="http://schemas.haulmont.com/cuba/window-ext.xsd"
            class="com.company.demo.web.screens.appprops.ExtAppPropertiesEdit"
            extends="com/haulmont/cuba/gui/app/core/appproperties/appproperties-edit.xml"
            messagesPack="com.company.demo.web.screens.appprops">
        <layout/>
    </window>
    
  • Register it in your web-screens.xml with the same id as the base screen:
    <screen id="appPropertyEditor" template="com/company/demo/web/screens/appprops/ext-appproperties-edit.xml"/>
    
  • Create a controller by copying the base class:
    public class ExtAppPropertiesEdit extends AppPropertiesEdit {
        // ...
        @Override
        public void init(Map<String, Object> params) {
            // ...
            if (item.getEnumValues() != null) {
                // change the logic here
            }
            // ...
        }
    }