jmix-docs icon indicating copy to clipboard operation
jmix-docs copied to clipboard

Document required MessageBundle adjustments in extended view

Open glebfox opened this issue 5 months ago • 0 comments

When extending/overriding a view and the MessageBundle is used in this parent view controller, it's required that the messageGroup of the new child view be set to the same value as that of the parent view. Otherwise, messages will be loaded with the messageGroup from a new view, and cannot be found. For example:

@Route(value = "pslock/pessimistic-locks", layout = MainView.class)
@ViewController("pslock_LockInfo.list")
@ViewDescriptor("ts-pessimistic-lock-list-view.xml")
public class TsPessimisticLockListView extends PessimisticLockListView {

    @Override
    public void onInit(InitEvent event) {
        messageBundle.setMessageGroup("io.jmix.pessimisticlockflowui.view.pessimisticlock");
        super.onInit(event);
    }
}

glebfox avatar Sep 27 '24 11:09 glebfox