That looks good.
Could be a candidate for seam JSF enhancement?
It appears like JSF goes hunting for the "closest" submit button it could find when you hit enter in a text field (including captcha .. which is the problem in my case).
I have users moaning the captcha doesn't work as they keep hitting enter after entering the text and it finds a cancel (it's hard enough to guess the letters anyhow without this!)
The workaround I found is to make the submit button for the page the closest button but this feels like a bit of a hack!
If someone creates a feature request in JIRA we can add this type of control to Seam UI.
I added my vote.
i was routed from here http://www.jboss.com/index.html?module=bb&op=viewtopic&t=118074
to this thread.
I hope that the default action will solve my problem.
So i can specify something like this
defaultAction type="SUBMIT" action="..."
form will submitted and action is the same thing zhat is possible with a commandButton
nothing happens and Focus stays in the field where the enterButton is pressed.
focus advances to the next input element
is this the way the corresponded Jira issue is targeted at?
No, I don't think we need to alter the default behaviour of the enter button - simply make it correspond to the 'normal' html behaviour - i.e.
<h:commandButton action="..."> <s:defaultAction /> </h:commandButton>
Even with this tag, there are problems when the form is submitted via ENTER. For example, it appears that in Firefox, the redirect following the form submission is executed as a POST. That's the way it looks in Wireshark, anyway.
In my case, if the user presses ENTER on the last page of a wizard and the action method ends the conversation, I see the "wizard complete" page flash up for a second, but then it redirects me to my no-conversation-view-id page and there's a warning in the Seam log about the conversation having expired.
Sorry, I'm not really understanding what you are saying, can you explain again? If there is a problem with s:defaultAction (it behaves differently to pressing the commandButton with the mouse) then we should fix it.