This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi. I have a Form containing some inputTexts and one commandButton. Is there any simple way to make the "Enter"-key make the commandButton to trigger? It feels very very inefficient to have a "onkeydown" listeners for every textfield that listens to every key press.... Any ideas?
Yes, but there's a catch. In most web browsers, when you have a single submit button, pressing "Enter" will submit the form.
However, the old offender: Internet Explorer, won't do that. So you have to put in browser-specific hacks. They're just gnarly enough that I don't remember the details, but you can Google for them. It's an HTML problem, not a JSF problem, so non-JSF apps have the save troubles.
An IDE is no substitute for an Intelligent Developer.
Joined: Jul 17, 2011
I´m not convinced. I´m using Chrome and this dose not trigger the button when I press "Enter" in selected textField: