PDA

View Full Version : Unable to set background on panel


cdasher
05-02-2008, 03:13 PM
1.0-beta2
...

ContentPanel panel = new ContentPanel();
panel.setStyleAttribute("background","#000000");

...

The background is never set. I also tried setting primary style attribute and using CSS to change background
and the style is never added.

darrellmeyer
05-02-2008, 05:12 PM
Please review the components javadocs before posting something as a bug. Moving this post to help.

panel.setBodyStyle("backgoundColor:white;");

Payam
06-27-2008, 11:21 PM
Thank god I ran into this post.
I was going nuts how to set the background color.

There needs to be more CSS examples.
In CSS it is "background-color" but here it is "backgroundColor".
For a Swing developer with minimal web development, its really hard to pick things up.

So as a general question,
whenever I see a attribute with a dash (eg. background-color), do I convert it to camel casing (eg. backgroundColor)?

gslender
06-28-2008, 02:01 AM
So as a general question,
whenever I see a attribute with a dash (eg. background-color), do I convert it to camel casing (eg. backgroundColor)?

yeppers

Payam
06-28-2008, 06:08 AM
Thanks! :)