2 Replies Latest reply on Mar 12, 2009 8:29 AM by dderry

    Adding hotkey to a menu

    dderry

      Is it possible to add a hotkey to a dropdown menu? So for example "alt+f" would open the 'File' dropdown menu? I've looked at the documentation for rich:hotkey, and it looks promising, but what would the handler be? rich:dropdownmenu doesn't seem to have a Javascript API to be invoked.

      Thanks,
      Dave Derry

        • 1. Re: Adding hotkey to a menu
          ilya_shaikovsky

           

          <script type="text/javascript">
           function newM(){
           #{rich:element('new')}.onclick();
           }
           </script>
           <rich:hotKey handler="newM();return false;" key="ctrl+up"/>
          

          and
          ...
           <rich:menuItem submitMode="ajax" value="New" id="new"
           action="#{ddmenu.doNew}" icon="/images/icons/create_doc.gif">
          ...


          works for me

          • 2. Re: Adding hotkey to a menu
            dderry

            Thanks Ilya. That looks like it's just what I need. I'll give it a shot.

            Dave