Hi,
Could somebody point me an example of how to achieve (in a login form) the login button to react to the ENTER KEY hit?
I found some code of year 2009 and think it could be outdated:
public void loginButtonClick(Button.ClickEvent event) {
getWindow().showNotification("CLICKED!", Window.Notification.TYPE_WARNING_MESSAGE);
}
public Action[] getActions(Object target, Object sender) {
Action[] actions = new Action[1]
;
//Set the action for the requested component
if (sender == loginBtn) {
//Bind the unmodified Enter key to the Ok button.
actions[0]
= new ShortcutAction("Default key", ShortcutAction.KeyCode.ENTER, null);
} else {
return null;
}
return actions;
}
public void handleAction(Action action, Object sender, Object target) {
if (target == loginBtn) {
this.loginButtonClick(null);
}
}