2 Replies Latest reply on Jan 22, 2009 6:21 PM by H G

    Switch runtime skins problems

    H G Newbie

      I created a new Plug-in skin using maven. After that I successful implement it and work very nice. So I decide to add skinability on runtime, switching skins on the fly, but I have a problem with rendering the styles. This is my code:

      <a4j:outputPanel id="panelToolBar">
       <a4j:form>
       <rich:toolBar id="bar" height="30" itemSeparator="line">
       <rich:toolBarGroup location="right" itemSeparator="line">
       <h:outputText value="skins" />
       <a4j:commandLink value="default" action="#{skin.setExplore}" reRender="panelToolBar" />
       <a4j:commandLink value="classic" action="#{skin.setClassic}" reRender="panelToolBar" />
       <a4j:commandLink value="blueSky" action="#{skin.setBlueSky}" reRender="panelToolBar" />
       </rich:toolBarGroup>
       </rich:toolBar>
       </a4j:form>
       </a4j:outputPanel>
      


      and this is what I have in web.

      <context-param>
       <param-name>org.richfaces.SKIN</param-name>
       <param-value>#{skin.actual}</param-value>
       </context-param>
      
      
       <context-param>
       <param-name>org.richfaces.CONTROL_SKINNING</param-name>
       <param-value>enable</param-value>
       </context-param>


      and this is my session bean:

      public class Skin {
      
       private String actual;
      
       public String getActual() {
       return actual;
       }
      
       public void setActual(String actual) {
       this.actual = actual;
       }
      
       public String setExplore() {
       setActual("explore");
       return "null";
       }
      
       public String setClassic() {
       setActual("classic");
       return "null";
       }
      
       public String setBlueSky() {
       setActual("blueSky");
       return "null";
       }
      
      }
      


      The first time when I click on a skin link, renders properly, but when I click on some skin that was applied doesn't change the skin. Maybe is nor rendering properly the styles.
      I try window.location.reload() using oncomplete. That is working in Firefox but not in IE7.