Hello,
I'm a newbie on gxt3.
I've a form with several field and i want that the "enter" submit my form ?
How do I do that ?
Thks
Hello,
I'm a newbie on gxt3.
I've a form with several field and i want that the "enter" submit my form ?
How do I do that ?
Thks
I've resolved my problem with :
Code:new KeyNav(myTextField) { @Override public void onEnter(NativeEvent evt) { evt.stopPropagation(); evt.preventDefault(); myTextField.finishEditing(); //Do the action } };
Any suggestions or examples, pls ?
What have you tried? Have you worked with key handlers at all, to see about adding a handler either to each field or to the form in general?
Another idea might be to have a preview handle (see com.google.gwt.user.client.Event.addNativePreviewHandler(NativePreviewHandler)), and watch for all key down events to see if they are an enter key, and if so, submit the form.
Do you use any components where the user is allowed to use the enter key, like a button, or a ComboBox/DateField (where the user can use the keyboard to navigate)? What should happen if the enter key is used there - should it both select that item and submit all at once?
Create a new GWT project in Eclipse and check "Generate project samle code".
There you will find the answer of your question.
I've resolved my problem with :
Code:new KeyNav(myTextField) { @Override public void onEnter(NativeEvent evt) { evt.stopPropagation(); evt.preventDefault(); myTextField.finishEditing(); //Do the action } };