| Author |
Message |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 23/08/2010 08:06:17
|
nickarls
Joined: 14/11/2006 00:00:00
Messages: 262
Offline
|
Hi,
Has anyone noticed some strangeness with input fields and action attributes? I'm seeing the issue of the first(?) available button action being called instead of what the field action points to...
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 24/08/2010 09:41:28
|
judy.guglielmin
Joined: 20/02/2007 00:00:00
Messages: 1196
Offline
|
Do you have an example for us? Perhaps a jira and attach the sample to it?
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 25/08/2010 10:46:01
|
nickarls
Joined: 14/11/2006 00:00:00
Messages: 262
Offline
|
judy.guglielmin wrote:
Do you have an example for us? Perhaps a jira and attach the sample to it?
For something like
Code:
<h:body>
<ice:form>
<ice:messages globalOnly="false" />
<ice:inputText value="#{credentials.username}"/>
<ice:inputText value="#{credentials.password}"/>
<ice:commandButton value="Login" action="#{credentials.login}" />
</ice:form>
</h:body>
the action is called whenever enter is pressed in one of the fields. Is this the intended behaviour?
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 25/08/2010 11:03:53
|
judy.guglielmin
Joined: 20/02/2007 00:00:00
Messages: 1196
Offline
|
The default behaviour is to add ajax to each component automatically.
You could try <f:ajax disabled="true".....
as per jira 5651
|
|
|
 |
![[Post New]](/JForum/templates/default/images/icon_minipost_new.gif) 26/08/2010 18:10:26
|
ken.fyten
Joined: 26/10/2004 00:00:00
Messages: 809
Online
|
Hi,
Yes, this is the intended behavior, as per http://jira.icefaces.org/browse/ICE-5574.
It's meant as a feature, as many browsers already treat "enter" on an input field as a trigger to submit the form, we thought it would be best if we implemented that so that the behavior would be identical across all browsers, regardless of their individual HTML policy on that.
If you feel this is too inflexible, etc. please provide detailed feedback.
Note that you can also prevent this from occurring by adding a "onKeypress" event listener to the inputText components and having that JS listener consume the key event to prevent it from bubbling up the DOM, and thus, being processed by the ICEfaces bridge to trigger the submit.
Regards,
Ken
|
Ken Fyten
VP Product Development
ICEsoft Technologies, Inc. |
|
|
 |
|
|