PDA

View Full Version : Can't show CheckBox in FormPanel



mercus
31 Oct 2009, 9:00 AM
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%"));

HtmlEditor html = new HtmlEditor();
html.setHideLabel(true);
panel.add(html, new FormData("100% -53"));

CheckBoxGroup options = new CheckBoxGroup();
options.setHideLabel(true);
CheckBox urgent = new CheckBox();
urgent.setBoxLabel("urgent");
CheckBox support = new CheckBox();
support.setBoxLabel("support");
options.add(urgent);
options.add(support);
panel.add(options, new FormData("100% -53"));


w.addButton(new Button("Send"));
w.addButton(new Button("Cancel"));
w.add(panel);

Button b = new Button("Open", new SelectionListener<ButtonEvent>() {

@Override
public void componentSelected(ButtonEvent ce) {
w.show();
}

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




After show the window, those CheckBox-es under the HtmlEditor will be unable to show.

How can I solve this problem?

Thank you.

mercus
31 Oct 2009, 8:24 PM
Solved.

Need to adjust from
panel.add(html, new FormData("100% -53"));

to
panel.add(html, new FormData("100% -80"));


Thank you.