В Интернете есть множество примеров такого кода:
Где вы видели такие примеры?
Думаю, такого метода не былов FormPanel (ранее ( 1.6 , 2.1 или даже в 2.3 ) Если вы хотите добавить обработчики onSubmit
и / или onSubmitComplete
, просто выполнитеТо же, что указано в документации:
// Add an event handler to the form.
form.addSubmitHandler(new FormPanel.SubmitHandler() {
public void onSubmit(SubmitEvent event) {
// This event is fired just before the form is submitted. We can take
// this opportunity to perform validation.
if (tb.getText().length() == 0) {
Window.alert("The text box must not be empty");
event.cancel();
}
}
});
form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
public void onSubmitComplete(SubmitCompleteEvent event) {
// When the form submission is successfully completed, this event is
// fired. Assuming the service returned a response of type text/html,
// we can get the result text here (see the FormPanel documentation for
// further explanation).
Window.alert(event.getResults());
}
});