PDA

View Full Version : [CLOSED] Beta 5: FormLayout in a collapsible BorderLayout issue



uwolfer
16 Jun 2008, 5:23 AM
If you try to add a FormLayout in a collapsible BorderLayout, you will encounter problems if you "minimize" the collapsible container, and then press the "temporary show" border. There will show up a small artifact, but not the container.
A workaround is to create a ContentPanel with a FitLayout and embed your FormLayout into that.

darrellmeyer
16 Jun 2008, 3:33 PM
Please include test code when posting bugs. Thanks.

uwolfer
16 Jun 2008, 11:18 PM
The bug is reproducible with the following example code on:
IE 7 on Win XP
Webkit
Firefox 3 on Win XP and Linux



package ch.tocco.nice2.web.core.gwt.shell.client;

import com.extjs.gxt.ui.client.Style;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Viewport;
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.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.extjs.gxt.ui.client.widget.layout.FillLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.RootPanel;

public class ShellModule extends LayoutContainer implements EntryPoint {

public void onModuleLoad() {
setStyleAttribute("margin", "8px");

Viewport v = new Viewport();
v.setLayout(new FillLayout());
v.add(this);
RootPanel.get().add(v);
}

@Override
protected void onRender(Element parent, int pos) {
super.onRender(parent, pos);

setLayout(new FitLayout());

ContentPanel searchContainer = new ContentPanel();
searchContainer.setLayoutOnChange(true);
searchContainer.setHeaderVisible(false);
searchContainer.setLayout(new BorderLayout());
BorderLayoutData layoutData = new BorderLayoutData(Style.LayoutRegion.WEST, 1f - 0.61803398903632919236f);
layoutData.setMargins(new Margins(10));
layoutData.setCollapsible(true);
layoutData.setSplit(true);
FormPanel p = new FormPanel();
TextField<String> firstName = new TextField<String>();
firstName.setFieldLabel("First Name");
p.add(firstName);
searchContainer.add(p, layoutData);
searchContainer.add(new ContentPanel(), new BorderLayoutData(Style.LayoutRegion.CENTER));
add(searchContainer);
}
}

uwolfer
17 Jun 2008, 3:13 AM
Also fixed now, see http://extjs.com/forum/showthread.php?t=38183.