My code is
FormPanel form =new FormPanel();
VerticalPanel holder = new VerticalPanel();
holder.add(new Label("User ID"));
nameTextBox = new TextBox();
nameTextBox.setName("userid");
holder.add(nameTextBox);
submitButton = new Button("Submit");
holder.add(submitButton);
form.add(holder);
submitButton.addClickListener(new ClickListener() {
@Override
public void onClick(Widget sender) {
form.submit();
}
});
form.addFormHandler(new FormHandler() {
public void onSubmit(FormSubmitEvent event) {
}
public void onSubmitComplete(FormSubmitCompleteEvent event) {
}
});
but when i submit form i get error
[ERROR] Uncaught exception escaped com.google.gwt.core.client.JavaScriptException: (TypeError): form.submit is not a function
please tell me the right way..