wombatkin
23 Jul 2009, 2:06 PM
Hello,
I've found strange behaviour when using FormPanel.submit() method. When form is submitted, browser opens a new window. This only happens when using IE7 (running on WinXP sp3) in both modes, in FF and chrome code works fine.
Here is sample code:
package tests.client;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.VerticalPanel;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.FormPanel.Method;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
public class Test implements EntryPoint {
public void onModuleLoad() {
VerticalPanel root = new VerticalPanel();
final FormPanel form = new FormPanel();
TextField<String> myField = new TextField<String>();
myField.setFieldLabel("Test field");
myField.setName("my-field");
form.add(myField);
form.setAction("/test/blank.html");
form.setMethod(Method.POST);
root.add(form);
Button btn = new Button("Submit on event");
btn.addListener(Events.Select, new Listener<ButtonEvent>(){
@Override
public void handleEvent(ButtonEvent be) {
form.submit();
}
});
root.add(btn);
RootPanel.get("entryPoint").add(root);
}
}
In GXT 2.0 this code wroks fine. Is this a bug or I'm doing the wrong things?
Thanks.
I've found strange behaviour when using FormPanel.submit() method. When form is submitted, browser opens a new window. This only happens when using IE7 (running on WinXP sp3) in both modes, in FF and chrome code works fine.
Here is sample code:
package tests.client;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.VerticalPanel;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.FormPanel.Method;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
public class Test implements EntryPoint {
public void onModuleLoad() {
VerticalPanel root = new VerticalPanel();
final FormPanel form = new FormPanel();
TextField<String> myField = new TextField<String>();
myField.setFieldLabel("Test field");
myField.setName("my-field");
form.add(myField);
form.setAction("/test/blank.html");
form.setMethod(Method.POST);
root.add(form);
Button btn = new Button("Submit on event");
btn.addListener(Events.Select, new Listener<ButtonEvent>(){
@Override
public void handleEvent(ButtonEvent be) {
form.submit();
}
});
root.add(btn);
RootPanel.get("entryPoint").add(root);
}
}
In GXT 2.0 this code wroks fine. Is this a bug or I'm doing the wrong things?
Thanks.