micgala
13 Mar 2009, 3:24 AM
Hi.
I am trying to use the FormData layout stuff for displaying my fields in the FormPanel.
Everything works fine, except for my ComboBox.
This is a simple test case showing the problem. As you can see, the Combo does not get the whole space...
public class StartupEntryPoint implements EntryPoint {
public void onModuleLoad() {
final Window w = new Window();
w.setPlain(true);
w.setSize(500, 300);
w.setHeading("Resize Me");
w.setLayout(new FitLayout());
FormPanel panel = new FormPanel();
panel.setBorders(false);
panel.setBodyBorder(false);
panel.setLabelWidth(55);
panel.setPadding(5);
panel.setHeaderVisible(false);
TextField<String> field = new TextField<String>();
field.setFieldLabel("Sent To");
panel.add(field, new FormData("100%"));
field = new TextField<String>();
field.setFieldLabel("Subject");
panel.add(field, new FormData("100%"));
SimpleComboBox<String> combo = new SimpleComboBox<String>();
combo.setFieldLabel("Test");
combo.add("Test");
panel.add(combo, new FormData("100%"));
TextArea area = new TextArea();
area.setHideLabel(true);
panel.add(area, new FormData("100% -53"));
w.addButton(new Button("Send"));
w.addButton(new Button("Cancel"));
w.add(panel);
w.show();
}
}
Tks for verifying!
Regards,
Michel.
I am trying to use the FormData layout stuff for displaying my fields in the FormPanel.
Everything works fine, except for my ComboBox.
This is a simple test case showing the problem. As you can see, the Combo does not get the whole space...
public class StartupEntryPoint implements EntryPoint {
public void onModuleLoad() {
final Window w = new Window();
w.setPlain(true);
w.setSize(500, 300);
w.setHeading("Resize Me");
w.setLayout(new FitLayout());
FormPanel panel = new FormPanel();
panel.setBorders(false);
panel.setBodyBorder(false);
panel.setLabelWidth(55);
panel.setPadding(5);
panel.setHeaderVisible(false);
TextField<String> field = new TextField<String>();
field.setFieldLabel("Sent To");
panel.add(field, new FormData("100%"));
field = new TextField<String>();
field.setFieldLabel("Subject");
panel.add(field, new FormData("100%"));
SimpleComboBox<String> combo = new SimpleComboBox<String>();
combo.setFieldLabel("Test");
combo.add("Test");
panel.add(combo, new FormData("100%"));
TextArea area = new TextArea();
area.setHideLabel(true);
panel.add(area, new FormData("100% -53"));
w.addButton(new Button("Send"));
w.addButton(new Button("Cancel"));
w.add(panel);
w.show();
}
}
Tks for verifying!
Regards,
Michel.