voyent
ace:pushButton doesn't trigger on ENTER  XML
Forum Index -> Components
Author Message
Shouran

Joined: 21/Jan/2016 02:50:53
Messages: 11
Offline


When the ace:pushButton is set as the page focus, through tabbing etc, and the user then presses ENTER, the action is not carried out.

If however the user presses SPACE then the button action is carried out.

I have figured out a workaround of using
Code:
<icecore:jsEventListener events="onkeypress" action="#{loginbean.login}" handler="enterKey">
 	<ace:pushButton value="Login" action="#{loginbean.login}" id="loginButton"></ace:pushButton>
 </icecore:jsEventListener>


but having to put this on every single button is going to require a lot of time.


How come the ace:pushButton doesn't support the ENTER key to submit it, but does support the SPACE key?

There are 11 kinds of people in this world. Those who understand binary and those who don't.
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1396
Offline


The icecore:defaultAction will allow you to specify the enter key on a form:-
http://www.icesoft.org/wiki/display/ICE/defaultAction

also, if you do not have an action or actionListener attribute on the ace:pushButton, you could use type="submit" on the ace:pushButton.
Shouran

Joined: 21/Jan/2016 02:50:53
Messages: 11
Offline


Default action defines a default action to carry out at the form level. We have multiple buttons per form. I just want the button action to be carried out when the user has the button selected through tabbing and presses ENTER.
This doesn't answer the question of why does the button support the user pressing SPACE to submit it, but not support ENTER.

There are 11 kinds of people in this world. Those who understand binary and those who don't.
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team