PDA

View Full Version : [beta3] ContentPanel background color



LukasP
21 May 2008, 3:34 AM
Could someone help me with getting a ContentPanel background color to white completely?

It works fine when not applying ContentPanel.setFrame(true) - but I would really like those round corners...

If I do something like:



public void onModuleLoad() {
Viewport vp = new Viewport();
ContentPanel panel = new ContentPanel();
HtmlContainer container = new HtmlContainer("<p>Hello world</p>");
container.setStyleAttribute("backgroundColor", "white");
container.setBorders(true);
panel.setLayout(new FlowLayout());
panel.setFrame(true);
panel.setStyleAttribute("backgroundColor", "white");
panel.add(container);
vp.add(panel);
RootPanel.get().add(vp);
}


I get a blue frame around my container which I would not like to have:
6948

This is not really crucial, but is there a solution other than changing the styles in ext-all.css?

Cheers

gslender
21 May 2008, 12:00 PM
not the best solution, but try using a deferredCommand and that way it will be done after render. The other solution is to extend ContentPanel, override render(), call super.render() and do it after that...if that makes sense.