Hello everybody,
I create 2 TextFields , and addShortcutListener to them …
TextField name = new TextField(“Name”);
name.addShortcutListener(new ShortcutListener(“Name”, ShortcutAction.KeyCode.ENTER, null) {
public void handleAction(Object sender, Object target) {
if(target==name){
// do my Search
}
}
});
and the second
TextField Descript = new TextField(“Description”);
Descript .addShortcutListener(new ShortcutListener(“Description”, ShortcutAction.KeyCode.ENTER, null) {
public void handleAction(Object sender, Object target) {
if(target==Descript ){
// do my Search
}
}
});
But i can’t do my search action when I press enter on the second textField… Plz ,Help
And of course, another (and maybe a better) way to do this is to add a ValueChangeListener to your TextField and set the TextField immediate. That way you’ll get a ValueChangeEvent when the user has changed the fields content and presses enter (or unfocuses the field).