4 Replies Latest reply on Jun 1, 2007 8:25 AM by andreigh.ts

    different skins for different concurent users

    andreigh.ts

      I have only seen how to change the skin globally, in web.xml.

      Is it possible to have 2 web users of the application use 2 different skins?

        • 1. Re: different skins for different concurent users
          ilya_shaikovsky

          yes. map your context param to the bean property and change its value in runtime.

          • 2. Re: different skins for different concurent users
            andreigh.ts

             

            "ilya_shaikovsky" wrote:
            yes. map your context param to the bean property and change its value in runtime.


            well, we use Jboss Seam and EJB3, so our backing beans are not defined with <managed-bean> xml tags.

            Is there any way to map the context-param to a EJB3 backing bean without using xml <managed-bean> mappings?



            • 3. Re: different skins for different concurent users
              andreigh.ts

               

              "ilya_shaikovsky" wrote:
              yes. map your context param to the bean property and change its value in runtime.


              I've tryed to change the context-param value, and it seems that it doesnt work: besides the fact that init parameter is global for the application, it seems that richfaces is caching the value somehow.

              What I need is to have different skins for 2 different concurrent sessions.
              Is it possible?

              • 4. Re: different skins for different concurent users
                andreigh.ts

                I find out how to make it work with seam:

                In web.xml EL expression needs to be used, that refers a seam component:

                <context-param>
                 <param-name>org.ajax4jsf.SKIN</param-name>
                 <param-value>#{richSkin.skinName}</param-value>
                </context-param>
                


                The seam component is session scoped:

                @Name("richSkin")
                @AutoCreate
                @Scope(ScopeType.SESSION)
                public class RichSkin {
                
                 private String skinName = "blueSky";
                 public String getSkinName() {
                 return skinName;
                 }
                
                 public void setSkinName(String skinName) {
                 this.skinName = skinName;
                 }
                
                }
                


                calling setter method of RichSkin component has the effect of changing the skin for the current session