I have a form inside a modal window. The form has a textfield field and a
button in it. I want to set the focus on the button when I enter something
in the textfield. I tried adding the following behaviour to the textfield
but it is not working.
textfield.add(new AbstractBehavior(){
private static final long serialVersionUID = 1L;
@Override
public void onComponentTag(Component component, ComponentTag
tag) {
tag.put("onkeydown",
"if(event.keyCode==13){searchButton.click();return false;}");
}
});
Also can someone suggest a way to hook up the button in the form with the
Enter key on the keyboard so that whenever I input something in the
textfield and hit the enter key the onClick() or onSubmit() event of the
button gets fired???
Any help will be greatly appreciated.
Thanks,
vishy
--
View this message in context:
http://www.nabble.com/Setting-a-button-press-on-hitting-the-enter-key-from-the-keyboard-tp20488048p20488048.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]