-
1. Re: JSF or Seam Question?
matt.drees Sep 2, 2007 3:42 PM (in response to tony.herstell1)I haven't used this, but it claims to do what you're asking:
http://www.jsftutorials.net/defaultActionTag.html -
2. Re: JSF or Seam Question?
tony.herstell1 Sep 2, 2007 3:49 PM (in response to tony.herstell1)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! -
3. Re: JSF or Seam Question?
pmuir Sep 2, 2007 5:37 PM (in response to tony.herstell1)If someone creates a feature request in JIRA we can add this type of control to Seam UI.
-
4. Re: JSF or Seam Question?
fernando_jmt Sep 2, 2007 7:10 PM (in response to tony.herstell1)I will be great to have this in Seam UI. Thanks.
JIRA issue added: http://jira.jboss.com/jira/browse/JBSEAM-1893 -
5. Re: JSF or Seam Question? - Now, hopefully, to be a Seam enh
tony.herstell1 Sep 3, 2007 3:53 AM (in response to tony.herstell1)Sounds good.
I added my vote. -
6. Re: JSF or Seam Question?
baz Sep 8, 2007 5:14 AM (in response to tony.herstell1)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 thisdefaultAction type="SUBMIT" action="..."
form will submitted and action is the same thing zhat is possible with a commandButtondefaultAction type="DONOTHING"
nothing happens and Focus stays in the field where the enterButton is pressed.defaultAction type="ADVANCEFOCUS"
focus advances to the next input element
is this the way the corresponded Jira issue is targeted at? -
7. Re: JSF or Seam Question?
pmuir Sep 8, 2007 5:25 AM (in response to tony.herstell1)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>
You can of course do what you are after using javascript. -
8. Re: JSF or Seam Question?
rhasselbaum Jan 18, 2008 11:26 PM (in response to tony.herstell1)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.
As a workaround, I'm disabling the ENTER key for text fields in my forms. The code on this site seems to do the trick nicely: http://www.webcheatsheet.com/javascript/disable_enter_key.php -
9. Re: JSF or Seam Question?
pmuir Jan 19, 2008 5:10 PM (in response to tony.herstell1)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.