Re: FormPanel's hidden target frame duplicates - can't receive state - in multi GWT app

2009-06-03 Thread pH4Lk0n

I've got the same problem in GWT 1.6.4.
I've tried to manually create another named frame, but response is
just displayed there so I don't know that the answer arrived.
Have anyone found solution to this problem??

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



FormPanel's hidden target frame duplicates - can't receive state - in multi GWT app

2009-04-20 Thread Evan

Hello everyone,
GWT 1.5 FormPanel create a hidden frame FormPanel1_# automatically
to handle the form submit return event. This works well on a single
GWT application for how ever many forms you create.
However when I create 2 GWT applications that use FormPanel and load
them on the same host page, the DOM start to have double hidden
frames. When I have 2 FormPanel on each GWT app the DOM gives me 4
hidden frames of name FormPanel1_1, FormPanel1_2, FormPanel1_1,
FormPanel1_2. The problem is that when a form submit result comes
back, it will placed on the first available frame of it's predefined
name. That is while the 2nd GWT app form's event listener is listening
on the 2nd FormPanel1_1, it's submit result form the server is
received at the 1st FormPanel1_1 so that listener never know the
result has returned. I tried to setting the target name with new
FormPanel([unique name]) but that will just open a new window and
the hidden frame never get created. Anyone have this issue? solution?

Thank you

Here is source code of GWT A. the GWT B is the exactly the same except
in a different GWT application:
===
package com.sample.testa.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.*;

public class TestA implements EntryPoint {
FormPanel form1 = new FormPanel();
FormPanel form2 = new FormPanel();
HTML message1 = new HTML();
HTML message2 = new HTML();

public void onModuleLoad() {
VerticalPanel mainPanel = new VerticalPanel();
// setup the first form
form1.setAction(request.php);
form1.setMethod(FormPanel.METHOD_GET);
form1.addFormHandler(new FormHandler(){
public void onSubmit(FormSubmitEvent event) {
message1.setHTML(message1.getHTML() + br + 
length: +
message1.getText().length());
}
public void onSubmitComplete(FormSubmitCompleteEvent 
event) {
message1.setHTML(message1.getHTML() +   + 
event.getResults());
}
});
VerticalPanel vp1 = new VerticalPanel();
Button submit1 = new Button(Submit);
submit1.addClickListener(new ClickListener(){
public void onClick(Widget w){
form1.submit();
}
});
// assemble
vp1.add(new HTML(h2Form1/h2));
vp1.add(message1);
vp1.add(submit1);
form1.add(vp1);
mainPanel.add(form1);


// setup up 2nd form
form2.setAction(request.php);
form2.setMethod(FormPanel.METHOD_GET);
form2.addFormHandler(new FormHandler(){
public void onSubmit(FormSubmitEvent event) {
message2.setHTML(message2.getHTML() + br + 
length: +
message2.getText().length());
}
public void onSubmitComplete(FormSubmitCompleteEvent 
event) {
message2.setHTML(message2.getHTML() +   + 
event.getResults());
}
});
VerticalPanel vp2 = new VerticalPanel();
Button submit2 = new Button(Submit);
submit2.addClickListener(new ClickListener(){
public void onClick(Widget w){
form2.submit();
}
});
// assemble
vp2.add(new HTML(h2Form2/h2));
vp2.add(message2);
vp2.add(submit2);
form2.add(vp2);

// attach to root panel
mainPanel.add(form2);
RootPanel.get(gwtTestA).add(mainPanel);
}

}

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---