2 Replies Latest reply on May 4, 2011 10:46 AM by martind1111

    jQuery hotkeys not working with RichFaces components

    martind1111

      In RichFaces 4.0.0.Final, if I include a RichFaces component such as rich:dataTable, rich:progressBar or rich:popupPanel on one of my pages, then the jQuery hotkeys don't work as expected. If I define the following script in my page:

       

      <script type="text/javascript">

      function initHotkeys() {

          jQuery(document).bind('keydown', 'Alt+space', function (evt) { alert('Alt-space'); return false; });

          jQuery(document).bind('keydown', 'B', function (evt) { alert('B'); return false; });

      }

       

      jQuery(document).ready(initHotkeys);

      </script>

       

      Then, when I press any key on that page, I see the "Alt+space" and "B" alerts popping up one after the other.

       

      I am trying to use jQuery hotkeys because rich:hotkeys component was deprecated in RichFaces 4.

       

      Martin

        • 1. jQuery hotkeys not working with RichFaces components
          ilya_shaikovsky

          seems default jQuery bind is called and not wrapped by hotKey. Check that your hotKey plugin is loaded ok and compatible with 1.4 jQuery which is bundled with RichFaces. And b.t.w. you should not load external jQuey to the page. Conflicts with bundled version will appears.

          • 2. jQuery hotkeys not working with RichFaces components
            martind1111

            Ilya,

             

            The version of jQuery hotkeys I am using is compatble with jQuery 1.4.2. When I load jQuery 1.4.2 and the compatible version of jQuery hotkeys without any RichFaces component on the page, the key binding works. So you are right, it must be incompatibility with the jQuery version that RichFaces loads.

             

            I have also found another version of jQuery hotkeys (version 0.7.9) in google code (pointed to by the jQuery web site), but it also does not work. It is supposed to be compatible with jQuery 1.3.2.

             

            Can you point me out to a version that is compatible with jQuery 1.4 (which is used by RichFaces 4.0.0.Final)?

             

            Martin