Originally posted by John Todd:
So, I have to create a hidden frame and assign an ID to it in my GWT host page?
You don't have to worry about it; GWT will create the frame for you if you just use the constructor FormPanel().
However, GWT gives you the option of creating a frame yourself if you want, and then you can pass that (or a reference to _self/ _top etc) to the constructor of the FormPanel - this can actually be useful for debugging if you want to see the actual raw data being returned by your service.
Originally posted by John Todd:
In case GWT will create it on the fly, how I'm supposed to access it with DOM since I don't its ID or name?
Again, you don't have to worry. In the the actual FormHandler onSubmitComplete() method you get access to the results through a FormSubmitCompleteEvent object that is passed in as a parameter - I was being a bit lazy with the method definition, in reality you would have:
form.addFormHandler(new FormHandler() {
public void onSubmitComplete(FormSubmitCompleteEvent event) {
String result = event.getResults());
}
public void onSubmit(FormSubmitEvent event) {
}
});
The onSubmitComplete() method is called by GWT code when the form submission is completed and GWT passes in a FormSubmitCompleteEvent object from which you can access the contents of the hidden frame - through that event's getResults() method.
//Adam