PDA

View Full Version : Setting style on FormPanel



glolar
3 Jul 2008, 1:00 PM
Using Ext GWT RC1,

In the onRender() method, I am trying to change the rendered heading on a FormPanel (from the default blue stripe and dark-blue bold text).

I tried using panel.setStylePrimaryName("my-style") and panel.setStyleName("my-style"), but neither works.

Also, panel.getStylePrimaryName() and panel.getStyleName() return null ... is this because the panel is not actually rendered yet???

I also tried panel.getHeader().setPrimaryStyleName() and panel.getHeader().setStyleName(). No go.

Heres a code snippet:

private FormPanel panel = new FormPanel();
panel.setHeading("Panel Heading");
panel.setStylePrimaryName("my-style");
.
.
.
panel.add(main); // (main is the LayoutContainer)

Yes, I created a style element named "my-style" in our css file.

Thanks in advance.

darrellmeyer
9 Jul 2008, 7:09 PM
Try
panel.getHeader().setTextStyle('your-style');

glolar
10 Jul 2008, 8:33 AM
darrellmeyer,

Thanks, but that had absolutely no effect. Still getting the default style.

glolar