Shortcut saveAndClose

Hello there, I want to add a shortcut for all details views of my application. I have done this:

@Subscribe
public void onInit(final InitEvent event) {
saveAndCloseBtn.addClickShortcut(Key.ENTER, KeyModifier.CONTROL);
}

But I want to avoid replacing the same code in all details views. I found in the Jmix documentation (UI Properties :: Jmix Documentation) this property that I presume should be added to the application properties:“jmix.ui.view.save-shortcut”.
I tried to configure it in this way: jmix.ui.view.save-shortcut = CTRL+ENTER, but it doesn’t work. Could you help me?

thanks in advance.

Hi,

A shortcut string representation must use - as a key separator. The name of the key must be one of com.vaadin.flow.component.Key, e.g. CONTROL-ENTER.

Regatds,
Gleb

Is there a default shortcut set by Jmix for the ‘save and close’ action and for the ‘discard’ action? Or is there a default mapping suggested by Jmix that we can use?

There are no default shortcuts. You can set any you see fit.