This content has been marked as final.
Show 1 reply
-
1. Re: Apply rich:hotkey on rich:datatable?
paul.dijou May 10, 2012 1:28 PM (in response to syanegal)What about something like:
<rich:hotKey selector=".aCSSclass" key="down" onkeyup="jQuery(this).parent('tr').next().find('.aCSSclass').focus()" />
And adding "styleClass="aCSSclass"" to your inputs (you can change the name of the CSS class of course).
The idea is to bind the hotKey to all your input with "selector=".aCSSclass"", and each time the "down" key is pressed, you start from you input with "jQuery(this)", go top to the row with "parent('tr')", go to the next row with "next()", then go down to the correct input in this row with "find('.aCSSclass')" and put the focus on it with "focus()".
Replace "down" with "up" and "next()" with "prev()" for the other key.
I'm not a jQuery expert, so I can have make a mistake on my syntax, but you got the main idea.
Regards,