Adding a keyboard shortcut for a new custom service
When you create a custom service for a Management Center business object, you can associate a keyboard shortcut with the service.
Before you begin
About this task
- Ensure the keyboard shortcut that you want to use for the custom action is not one that is already used in Management Center. If you define a keyboard shortcut that is already used, when the business user uses the keyboard shortcut, two actions occur.
- Ensure the keyboard shortcut that you want to use for the custom action is not one that is already used for the web browser. For instance, do not use a shortcut that the business user can use with Management Center.
- The order of the combination of keys is the order that the business user must press for the
keyboard shortcut. For example, if you define a keyboard shortcut as
shortcutKeys="['Control', '1']
, then a business user must hold down the Ctrl key, and then the 1 key on the keyboard. - Keyboard shortcuts are not case sensitive. For example,
shortcutKeys="['Control', 'p']
andshortcutKeys="['Control', 'P']
both are triggered when a user presses the Ctrl key and the P key. - Keyboard shortcuts can be any number of keys, including a single key, but consider the usability of complicated or lengthy keyboard combinations. Typically, you do not want to create a keyboard shortcut that involves more than three keys.
Procedure
- Open HCL Commerce Developer and switch to the Enterprise Explorer view.
- Expand, component is the name of the Management Center component. , where
- Open the object definitions file for the business object that contains the custom service definition that you want to change.
-
Add the
shortcutKeys
attribute to theCustomService
element.For example, the following code snippet shows how to define ashortcutKeys
attribute<CustomService url="/cmc/ActivatePromotion" toolbarIcon="activateToolbarIcon" displayName="${promotionResources.promotionList_activate_displayName}" shortcutKeys="['Control', '1']"> <EnablementCondition conditionId="activate" propertyName="status" enablementValue="Inactive" /> <ServiceParam name="promotionId" propertyName="promotionId"/> </CustomService>
- Save and publish your changes.