4 Replies Latest reply on May 11, 2007 3:30 PM by sergeysmirnov

    Changing themes

      I'm interested in changing predefined themes on the web page (ex. ruby, wine, classic...)for the richfaces components.I have tried to do that through the one bean named theme who has a field look.That field is value binded in the web.xml

      <context-param>

      <param-name>org.ajax4jsf.SKIN</param-name>

      <param-value>#{theme.look}</param-value>

      </context-param>

      and that works if I change it.But the thing that I' m interested in how to do that through the code without touching and modifying dinamicaly
      the web.xml file, something like the language selector and the message bundle that is supported by the seam component.
      Thanks in advance!!

        • 1. Re: Changing themes
          ilya_shaikovsky

          you may use predefined a4jSkin object to dynamicaly set the skin from java code.

          • 2. Re: Changing themes

            Ok! but can you show me the piece of code how to do that?

            • 3. Re: Changing themes
              ilya_shaikovsky

              Sorry I missed the point...

              Ignore my post about this bean.. It was designed for another case.

              From the beggining your way was right.. When you point org.ajax4jsf.SKIN to your bean in web.xml - you didn't make the web.xml dynamically changed as you write. You just make your bean responsible for saving and switching application skin. So the way you described from the beggining - was designed way to perform the chanes.

              • 4. Re: Changing themes

                tkalactomo, i do not understand your phrase about "touching and modifying dynamically the web.xml file" in case of
                <context-param>
                <param-name>org.ajax4jsf.SKIN</param-name>
                <param-value>#{theme.look}</param-value>
                </context-param>

                You need to manipulate with theme.look property, but with web.xml. web.xml is not required to be changed.