Set submit button on page with multiple buttons

I have got the problem that my JSF page has multiple commandButtons on one page.

Depending on what the user does I want a certain button to the pressed when the user clicks enter on the keyboard, e.g. if the user is just editing the password field and presses enter I would like the login button to execute the submit.

Is that possible? Any help would be much appreciated.

Steffen

[405 byte] By [duesia] at [2007-11-27 7:04:26]
# 1

Just call the login method at the end of the save password method?

JSF<h:commandButton value="save password" action="#{myBean.savePassword}" />

<h:commandButton value="login" action="#{myBean.login}" />

MyBeanpublic void savePassword() {

// Do your thing to save the password.

login();

}

public void login() {

// Handle login.

}

BalusCa at 2007-7-12 18:55:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...