PDA

View Full Version : MultiField rendering issue when used in FieldSet



moldoe
7 Jul 2009, 12:59 PM
I have a FieldSet which by default is collapsed. The field set uses FormLayout to render multiple MultiFields which may have checkboxes, textfields and comboboxes.
When the FieldSet is expanded the fields inside the MultiField are not rendered properly(they overlap partialy). If FieldSet is expanded by default everything seems to be fine, except there seem to be small width difference between combobox from row 1 and textfield from row 2. Please take a look at my test code.

GXT 2.0
Windows XP
Hosted Mode
IE 8



public class Test implements EntryPoint {


public void onModuleLoad() {

Viewport viewport = new Viewport();

ContentPanel contentPanel = new ContentPanel();
contentPanel.setLayout(new RowLayout());

FormLayout formLayout = new FormLayout(FormPanel.LabelAlign.TOP);
FieldSet fieldSet = new FieldSet();
fieldSet.setCollapsible(true);
fieldSet.setExpanded(false);
fieldSet.setHeading("Field Set");
fieldSet.setLayout(formLayout);

contentPanel.add(fieldSet);

MultiField mf1 = new MultiField("Multi Field 1");
mf1.setSpacing(5);
ComboBox comboBox1 = new ComboBox();
comboBox1.setStore(new ListStore());
comboBox1.setWidth(80);
mf1.add(comboBox1);
ComboBox comboBox2 = new ComboBox();
comboBox2.setStore(new ListStore());
comboBox2.setWidth(150);
mf1.add(comboBox2);
fieldSet.add(mf1);

MultiField mf2 = new MultiField("Multi Field 2");
mf2.setSpacing(5);
ComboBox comboBox3 = new ComboBox();
comboBox3.setStore(new ListStore());
comboBox3.setWidth(80);
mf2.add(comboBox3);
TextField textField1 = new TextField();
textField1.setWidth(150);
mf2.add(textField1);
fieldSet.add(mf2);

contentPanel.setSize(400, 400);
viewport.add(contentPanel);

RootPanel.get().add(viewport);

}
}
Thanks,

Daniel

sven
7 Jul 2009, 1:09 PM
The problem is that layouting hidden items it not really possible in browsers. We wrote some ways around this. So if you hide something initially, it didnt get rendered until you expand it. This will make it into 2.0.1

For now i suggest to first fill the fieldset in the expand event (that also makes initial show faster)

moldoe
7 Jul 2009, 1:12 PM
OK. Thanks for your suggestion.

Daniel