PDA

View Full Version : [GXT 1.1-alpha4] Window



devdev
15 Sep 2008, 3:14 AM
Hi,
My team encountered some problems with Window, which works fine in Mozilla Firefox but giving an unknown runtime error no. -2146827687 in IE6 (Internet Explorer).

Would be nice to have this fixed




import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.Style;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;


public class BugProof extends LayoutContainer implements EntryPoint {

private Button button;
private Window window;
private FormPanel formPanel;
private FormPanel detailsPanel;
private FormPanel bugPanel;
private Button buttonOnPanel;
private LabelField labelField;

public void onModuleLoad() {
RootPanel.get().add(this);
}

public BugProof() {
setLayout(new FitLayout());
bugPanel = new FormPanel();
button = new Button("Click me!");
bugPanel.addButton(button);
add(bugPanel);
buttonOnPanel = new Button("Click click");
detailsPanel = new FormPanel();
detailsPanel.setHeaderVisible(false);
detailsPanel.setBodyBorder(false);
detailsPanel.setFrame(false);
detailsPanel.setLayout(new FitLayout());
labelField = new LabelField("labelField");
detailsPanel.add(labelField);
window = new Window() {
@Override
protected void beforeRender() {
super.beforeRender();
setButtonAlign(Style.HorizontalAlignment.CENTER);
addButton(new Button("button1"));
addButton(new Button("button2"));
setId("BugProof");
}
};
window.setHeading("heading");
formPanel = new FormPanel();
formPanel.setLayout(new FlowLayout());
formPanel.setHeaderVisible(false);
formPanel.setBodyBorder(false);
formPanel.add(buttonOnPanel);
formPanel.add(detailsPanel);
window.add(formPanel);

}

@Override
protected void afterRender() {
super.afterRender();

button.addSelectionListener(new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent event) {
window.show();
}
});
}
}

darrellmeyer
15 Sep 2008, 10:20 AM
Try the following code. You should use a FlowLayout as the outer container has no specified size which will give FitLayout problems. Also, all the beforeRender and afterRender code is not needed. In most cases, you should not need to override these methods.


public class Test extends LayoutContainer implements EntryPoint {

private Button button;
private Window window;
private FormPanel formPanel;
private FormPanel detailsPanel;
private FormPanel bugPanel;
private Button buttonOnPanel;
private LabelField labelField;

public void onModuleLoad() {
RootPanel.get().add(this);
}

public Test() {
setLayout(new FlowLayout());
bugPanel = new FormPanel();
button = new Button("Click me!");
bugPanel.addButton(button);
add(bugPanel);
buttonOnPanel = new Button("Click click");
detailsPanel = new FormPanel();
detailsPanel.setHeaderVisible(false);
detailsPanel.setBodyBorder(false);
detailsPanel.setFrame(false);
detailsPanel.setLayout(new FitLayout());
labelField = new LabelField("labelField");
detailsPanel.add(labelField);
window = new Window();
window.setButtonAlign(Style.HorizontalAlignment.CENTER);
window.addButton(new Button("button1"));
window.addButton(new Button("button2"));
window.setId("BugProof");
window.setHeading("heading");
window.setWidth(400);
formPanel = new FormPanel();
formPanel.setLayout(new FlowLayout());
formPanel.setHeaderVisible(false);
formPanel.setBodyBorder(false);
formPanel.add(buttonOnPanel);
formPanel.add(detailsPanel);
window.add(formPanel);
button.addSelectionListener(new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent event) {
window.show();
}
});
}
}

devdev
17 Sep 2008, 1:08 AM
Hi,

It still doesn't work in IE6 :(

I will describe my problem in more detail.
My team was migrating to the newest version ( GXT 1.1-alpha4), when we encountered some problems described in: http://extjs.com/forum/showthread.php?p=225084#post225084 . We thought, that the issue was caused by Grids, but then we noticed that all Windows that we have used, don't work any more in IE6 in GXT 1.1-alpha4 (but in GXT 1.0.x everything was fine).

I found, that problem might be caused by LabelField - after removal of all LabelFields, I don't see the issues any more.

Any solution ?