arnabmitra
arnabmitra

Reputation: 953

jsf enter key pressed problem

i have a xhtml popup page which has two buttons.The two buttons have actionListener methods in their backing beans. When the user clicks enter how can i ensure that the first buttons actionListener method gets called.

Upvotes: 0

Views: 2059

Answers (1)

Damo
Damo

Reputation: 11550

Several frameworks provide a tag to allow for this, for example <s:defaultAction/> from Jboss Seam. It is just adds a piece of javascript to your page that listens for the enter key.

If you aren't using Seam or similar, then add the javascript yourself - for example something like this

Upvotes: 1

Related Questions