The example from FormPanel's javadoc says:
"...Assuming the service returned a response of type text/html, we can get the result text here (see the FormPanel documentation for further explanation)..."
However the javadoc doesn't explain a bit about this topic. Has anyone found how to get the HTML response sent back from server after a form submission?
Add a FormHandler to your FormPanel, and in onSubmitComplete you will receive a FormSubmitCompleteEvent. Invoke its getResults() method to obtain the result.
form.addFormHandler(new FormHandler() {
public void onSubmit(FormSubmitEvent event) { // validation etc }
public void onSubmitComplete(FormSubmitCompleteEvent event} {
Window.alert(event.getResults()); // display the result
}
};
Following the answear from "Robert Munteanu" you should look at:
http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/ui/FormPanel.SubmitCompleteEvent.html
And there you can see :
getResults
public java.lang.String getResults()
Gets the result text of the form submission.
Returns:
the result html, or null if there was an error reading it
Tip:
The result html can be null as a result of submitting a form to a different domain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With