PDA

View Full Version : [CLOSED] Form blue background depends on setFrame(true)



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);
}
}

darrellmeyer
23 Jun 2008, 7:02 AM
This is not a bug. When you use the "frame" style a background color is set. Without the "frame" style, no background color is set and therefore the background is "transparent". If you want a blue background when not using the "frame" style, you will need to set it. You could do:


panel.setBodyStyle("backgroundColor:white");
// or
panel.setBodyStyleName("youStyleWithBackground");