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

Before you add a keyboard shortcut to the Management Center user interface, ensure that you define the custom service action. For more information, see Define the custom service action.

About this task

You can use any combination of keys on the keyboard to create your keyboard shortcut, but keep the following logistics in mind when you are creating your keyboard shortcut:
  • 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'] and shortcutKeys="['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

  1. Open HCL Commerce Developer and switch to the Enterprise Explorer view.
  2. Expand, LOBTools > WebContent > WEB-INF > src > xml > commerce > component > objectDefinitions, where component is the name of the Management Center component.
  3. Open the object definitions file for the business object that contains the custom service definition that you want to change.
  4. Add the shortcutKeys attribute to the CustomService element.
    For example, the following code snippet shows how to define a shortcutKeys 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>
  5. Save and publish your changes.