1

I am developing a web application with JSF with Primefaces. It is essential to navigate with keys within most of the JSF pages, avoiding the mouse as much as possible. Return key is preferred to forward navigation than the Tab key. The navigation path is mostly predetermined, but some cases, it is decided on run. For example, pressing the return key at the txtItemQuantity input box, cursor has to go to dtpExpiry, if the items has an expiry date or need to click the Add button if there is no expiry date. How can I achieve this functionality?

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
Buddhika Ariyaratne
  • 2,339
  • 6
  • 51
  • 88
  • 3
    This is not a JSF/PrimeFaces problem instead a generic web application, html, javascript problem. Remember that JSF in the end is a HTML generator. – Luiggi Mendoza Apr 09 '13 at 22:57
  • 1
    You should be able to do it using jQuery, watch out http://api.jquery.com/keypress/ Be careful on how to include jQuery and access your elements, more info: http://stackoverflow.com/questions/8667980/how-to-use-jquery-with-jsf-2-0. – Rodmar Conde Apr 10 '13 at 10:38

0 Answers0