PDA

View Full Version : form layout problem - test with the last version



diegolovison
21 Oct 2009, 7:24 AM
public class Main implements EntryPoint {

RadioGroup radioGroup2;
ComboBox<BeanModel> comboBox2;

@Override
public void onModuleLoad() {

final ListStore<BeanModel> store1 = new ListStore<BeanModel>();

final ComboBox<BeanModel> comboBox1 = new ComboBox<BeanModel>();
comboBox1.setFieldLabel("combo 1");
comboBox1.setAllowBlank(false);
comboBox1.setStore(store1);
comboBox1.setDisplayField("nome");

final Radio radio1a = new Radio();
radio1a.setBoxLabel("1a");
radio1a.setValue(true);
radio1a.setWidth(120);

final Radio radio1b = new Radio();
radio1b.setBoxLabel("1b");
radio1b.setWidth(120);

final RadioGroup radioGroup1 = new RadioGroup("radioGroup1");
radioGroup1.setFieldLabel("radio group");
radioGroup1.add(radio1a);
radioGroup1.add(radio1b);
radioGroup1.setFireChangeEventOnSetValue(true);
radioGroup1.addListener(Events.Change, new Listener<FieldEvent>() {
@Override
public void handleEvent(final FieldEvent be) {

if (radio1a.getValue()) {

radioGroup2.show();
comboBox2.hide();

} else if (radio1b.getValue()) {

radioGroup2.hide();
comboBox2.show();
}
}
});

final Radio radio2a = new Radio();
radio2a.setBoxLabel("2a");

final Radio radio2b = new Radio();
radio2b.setBoxLabel("2b");
radio2b.setValue(true);

radioGroup2 = new RadioGroup("radioGroup2");
radioGroup2.setFieldLabel("radioGroup2");
radioGroup2.add(radio2a);
radioGroup2.add(radio2b);
radioGroup2.setFireChangeEventOnSetValue(true);

final ListStore<BeanModel> store2 = new ListStore<BeanModel>();

comboBox2 = new ComboBox<BeanModel>();
comboBox2.setStore(store2);
comboBox2.setAllowBlank(false);
comboBox2.setFieldLabel("combo2");
comboBox2.disable();
comboBox2.hide();

final FormLayout layout = new FormLayout();
layout.setLabelWidth(190);

final ContentPanel panel = new ContentPanel();
panel.setLayout(layout);
panel.setStyleAttribute("padding", "10px 0px 0px 19px");
panel.setHeading("panel");
panel.setFrame(true);
panel.add(comboBox1);
panel.add(radioGroup1);
panel.add(radioGroup2);
panel.add(comboBox2);
panel.setCollapsible(true);

RootPanel.get().add(panel);
}
}


select the radio "1b", the combobox will appers with the width incorrect, and the field label with more five pixel...

you able to reproduce?

sven
21 Oct 2009, 7:27 AM
Please use the forum serach before posting.


You can use hidemode offset for the combobox, or you need to update to GXT 2.0.2 or above. GXT 2.0.2 added a workaround for this browser limitation.

diegolovison
21 Oct 2009, 7:28 AM
its the same problem?

http://www.extjs.com/forum/showthread.php?t=81947

sven
21 Oct 2009, 7:29 AM
Yes

diegolovison
21 Oct 2009, 7:31 AM
hmm.. I dont know..

thanks for your reply.. :)