Grandiosa
23 Jun 2008, 12:34 AM
I'm not sure this is a bug but unless you call setFrame(true) on a formpanel its background will turn white.
If this property shall control background style as well as rounded fame corners it should be named something else, like FormPanel.setEnhancedStyle(true) or something..
public class Main implements EntryPoint {
public void onModuleLoad() {
Viewport vp = new Viewport();
vp.setLayout(new FitLayout());
ContentPanel top = new ContentPanel(new CenterLayout());
FormPanel panel = new FormPanel();
// commenting out following line will make form background white ??
panel.setFrame(true);
panel.setFieldWidth(210);
panel.setWidth(380);
panel.setLayout(new FlowLayout());
panel.add(new LabelField("User data"));
TextField<String> tf = new TextField<String>();
tf.setValue("Test");
tf.selectAll();
tf.setSelectOnFocus(true);
panel.add(tf);
top.add(panel);
vp.add(top);
RootPanel.get().add(vp);
}
}
If this property shall control background style as well as rounded fame corners it should be named something else, like FormPanel.setEnhancedStyle(true) or something..
public class Main implements EntryPoint {
public void onModuleLoad() {
Viewport vp = new Viewport();
vp.setLayout(new FitLayout());
ContentPanel top = new ContentPanel(new CenterLayout());
FormPanel panel = new FormPanel();
// commenting out following line will make form background white ??
panel.setFrame(true);
panel.setFieldWidth(210);
panel.setWidth(380);
panel.setLayout(new FlowLayout());
panel.add(new LabelField("User data"));
TextField<String> tf = new TextField<String>();
tf.setValue("Test");
tf.selectAll();
tf.setSelectOnFocus(true);
panel.add(tf);
top.add(panel);
vp.add(top);
RootPanel.get().add(vp);
}
}