2 Replies Latest reply on Feb 13, 2009 8:18 PM by sergeysmirnov

    dynamic skinning

    ajanz

      how can i use dynamic skinning like in the demo app?

      i want to implement a menu to switch skinning at runtime.

        • 1. Re: dynamic skinning
          nbelaevski
          • 2. Re: dynamic skinning

            web.xml:

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


            faces-config.xml:

            <managed-bean>
             <managed-bean-name>skinBean</managed-bean-name>
             <managed-bean-class>com.yourpath.SkinBean</managed-bean-class>
             <managed-bean-scope>session</managed-bean-scope>
             <managed-property>
             <property-name>skin</property-name>
             <property-class>java.lang.String</property-class>
             <value>blueSky</value>
             </managed-property>
            


            So, when the skin property of this skinBean is changed, the skin for the page is changed. Be sure, the page is reloaded regularly. You cannot change the skin for part of the page (I.e. during the Ajax call)