Tech Tip: Add Keyboard Shortcuts through CUI

Tech Tip: Add Keyboard Shortcuts through CUI

We've previously covered how you can utilize CUI to add custom buttons to toolbars. However, you can also take advantage of CUI to add keyboard shortcuts for more advanced users. In this blog post, we will cover how to add a shortcut to select all of the items in a grid when a user presses "Ctrl+A".

Getting Started

You can find all of the code in this blog post in the cui-shortcut project on the Aras Labs GitHub.


Note: This project will should only be used with Aras 11 SP7 and later. The necessary CUI capabilities were not yet implemented in versions earlier than 11.0 SP7.

Create the Shortcut Handler

We will begin with writing the Method that will select all of the items in the grid.

  1. Create a new JavaScript method called my_mws_ctrl_a
    1. This follows the naming conventions of the other shortcuts which will make it easier to find in the future
    2. MWS stands for "Main Window Shortcut"
  2. Copy and paste the code from the editor below into this new method
  3. Save, unlock, and close the my_mws_ctrl_a method

Adding the Shortcut

  1. In the TOC, navigate to Administration > Configuration > Client Presentation and click the hyperlink highlighted below
  2. In the Command Bar Section relationship tab, search for the item below 
    • Classification: Data Model
    • Name: com.aras.innovator.cui_default.main_window_main_menu
    • Location: Main Window Main Menu
  3. Open and lock this item
  4. In the Command bar Item relationship tab, create a new item with the information below
    • ItemType: Shortcut
    • Name: my.cui.mws_ctrl_a
    • Action: Add
    • For Identity […]: World
      • This is the group of users that will be able to use this shortcut
  5. Right-click > View "Command Bar Item" to view this shortcut in a new window
  6. Fill in the following information
    • Handler: my_mws_ctrl_a
    • Shortcut: ctrl+a
  7. Save, unlock, and close this Shortcut
  8. Save, unlock, and close the Command Bar Section

You can now try out this new shortcut by selecting any ItemType in the TOC and clicking ctrl+a. You should see that all of the items in the grid are selected.


Subscribe to our blog and follow @ArasLabs on Twitter for more helpful content! You can also find our latest open-source projects and sample code on the Aras Labs GitHub page.

Mike Lindner
  • Hi Ralf, I ran a quick test in our latest release of 11.0 SP12, and it seems that this shortcut is now included OOTB in all grids including the main grid and relationship grids. For older releases, including the previous open release of 11.0 SP9, you would still need to add this shortcut manually. -Chris
  • Hi Chris, thanks, this will solve one issue that we have with our migration to Aras 11. But shouldn't this be a standard feature in all grids, not only the main window grid? What about relationship tab grids? I would expect CTRL-A to work in any kind of grid out of the box without the need to "customize" it in the first place. \Ralf
  • Hi Chris, Thank you very much,If you don't mind,I will continue to follow your blog and posted on my chinese website.Let more Chinese people know. -Joe
  • Hi Joe, I believe what you're looking for is referred to as a Sidebar button. While it is possible to create your own custom sidebar through CUI, we don't currently have any guides to show off how to do this. I am planning on continuing this series of blogs that demonstrate CUI, and creating a custom sidebar was going to be my next topic anyway. You can follow the Aras Labs Twitter account for notifications of when new blogs are posted. -Chris
  • Hi Chris, Thank you for your reply,like ArasPDFViewer function,I want to click CUI button show page in current window,cui button can switch tab,Now, I don't know how to create tab page and switch it.If you know, please guide me,thank you very, very much.