1

I'm using Primefaces 5.1 with JSF. I have some divs that have an add button inside it. I'm wondering if there's a way to set a Primefaces hotkey to be called only when I have the focus in an element that is inside this div (and calls the add function of that button inside the div). Any idea? Thanks!

chr0x
  • 1,151
  • 3
  • 15
  • 25
  • I don'tthink you can. Think you have to revert to plain jquery like http://stackoverflow.com/questions/148361/how-can-i-give-keyboard-focus-to-a-div-and-attach-keyboard-event-handlers-to-it/148444#148444 and combine that with a remoteCommand. But it is an interesting request. Maybe filing an issue in the pf issuelist will result in PF adding it – Kukeltje Feb 18 '15 at 19:22
  • 1
    As @Kukeltje said, your best bet is to use jQuery. Oleg Varaksin wrote [a great blog post](http://ovaraksin.blogspot.fr/2012/12/register-hotkeys-for-primefaces-dialogs.html) about a similar request. I will post an answer with the code snippets if you're happy with this solution. – Zim Feb 19 '15 at 12:07

0 Answers0