tags:

views:

523

answers:

2

I have an h:selectOneMenu and an a4j:commandButton, the latter of which reRenders a component called content which looks like this:

<rich:panel id="content">
 <a4j:include viewId="#{MyBacking.viewId}" />
</rich:panel>

When the response is rendered and the component loads the content of the new JSP page, the tabs contained in that page use a skin that is different from the rest of the app (I think default blue).

I've noticed that after the included code is loaded, if I hit refresh, although this causes the bean to reissue the page contents, the skin is properly assigned.

My web xml says:

<context-param>
 <param-name>org.richfaces.SKIN</param-name>
 <param-value>glassX</param-value>
</context-param>

<context-param>
 <param-name>org.richfaces.CONTROL_SKINNING</param-name>
 <param-value>enable</param-value>
</context-param>

<context-param>
 <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
 <param-value>enable</param-value>
</context-param>
  1. Is this effect because RichFaces is in some way not in control of the rendering of the tabs at this point?

  2. How can I ensure the tabs conform to the skin? All the documentation is relating to overriding a skin, and I'd rather not have to override and skin with the skin that it should already have.

Thanks

A: 

I've just noticed I'd included a styleClass parameter - and because the jsp is now included didn't have access to the css facet reference.

Mark Lewis
interesting though, i've just removed all style references, and the tabs are still blue. lame.
Mark Lewis
+1  A: 

I am not sure if it will solve your problem, however you can try to force Richfaces to avoid using the default skin by setting a specific web.xml parameter:

<context-param>
    <param-name>org.richfaces.LoadStyleStrategy</param-name>
    <param-value>ALL</param-value>
</context-param>

You can find more details about this property here.

edited, to set the correct param-value, as stated in the comments.

romaintaz
Actually, for all those who after us, what I needed to set was `<param-value>ALL</param-value>` although as far as this question was concerned it was answered correctly. I needed to use ALL as using NONE (which skinned the tabPanel correctly) removed all my other style (fonts etc) as listed in romaintaz's link. Using ALL fixed it so both the style was used and was perpetuated. A thoroughly deserved 100 rep inc.
Mark Lewis
Thanks. I've edited my answer in order to use the correct `param-value`.
romaintaz