Keyboard Support in Actions

Keyboard support enables you to navigate through content by using specified keys.

Every action available in Backoffice Framework can define a set of keys on which it is triggered. If an action uses com.hybris.cockpitng.actions.impl.DefaultActionRenderer then the keyboard support is available out of the box.

If not, you can set keyboard support on your own. The following example shows how an action can be configured, in this snippet it is the Delete Action: <y:action action-id="com.hybris.cockpitng.action.delete" property="selectedObjects" triggerOnKeys="#del"/>

For details regarding control keys, refer to Allowed Control Keys table available at https://www.zkoss.org/wiki/ZK_Developer%27s_Reference/UI_Patterns/Keystroke_Handling#Allowed_Control_KeysInformation published on non-SAP site.

It is possible to have multiple control keys assigned to triggerOnKeys. For example, triggerOnKeys="@c^a#f10^#f3" results in:

  • alt + c (@c)
  • ctrl + a (^a)
  • F10 (#f10)
  • ctrl + F3 (^#f3)

If custom action has a defined custom action renderer which does not use DefaultActionRenderer, then this functionality has to be handled manually by listening Events.ON_CTRL_KEY on com.hybris.cockpitng.components.Action component, which is passed to com.hybris.cockpitng.actions.CockpitActionRenderer#render method.