Pages

Monday, August 1, 2016

How to set hotkeys for buttons in Oracle Apex



Hi all,

I would like you to show how to implement hotkey for Buttons in Oracle Apex.


  1. Create button and give Static Id to that button. For Example:

                

  2. Click on Edit Page and in JavaScript Execute when Page Loads properties
     write following JavaScript code:

                  document.getElementById("back").accessKey = "c";
       

     
    and then save the changes. Action of button with static id "back" will be executed when we for example on Chrome press [ALT]  and "c" key

    Note: The shortcut varies from different browsers:

    IE, Chrome, Safari, Opera 15+: [ALT] + accesskey  
    Opera prior version 15: [SHIFT] [ESC] + accesskey  
    Firefox: [ALT] [SHIFT] + accesskey

5 comments:

  1. Hi Nihad,

    thanks for this nice post.

    I have got a little addition about the keys on Mac:
    Chrome, Firefox: [Ctrl][Alt] + accesskey
    Safari : could not find it yet :-(

    Thanks,
    Dick

    ReplyDelete
  2. Hi Nihad,

    While I love using JavaScript, in this case it's probably simpler and more efficient to use the Custom Attributes property of the button. Setting that to something like the following should do the trick:
    accesskey="c"

    ReplyDelete
  3. Hi Dan,

    Thank You for your Advice. It's working.

    ReplyDelete