0 Replies Latest reply on Feb 11, 2011 6:17 AM by Ronald K.

    Conversation depending richfaces skin

    Ronald K. Newbie


      in my project (Seam + RichFaces) I need to change the RichFaces skin depending on a user input.
      This works fine, as long as the backing bean holding the current skin type is session scoped.
      But I need to change the skin only in the current conversation (a user may use the application in multiple browser windows, each showing the application using a different skin). Therefore I changed the backing bean to conversation scope.

      But that does not work! When RichFaces looks up the skin, new temporary conversations are opened and the default skin type of the newly created SkinState object is returned.

      The skin type is first set after login and when the user changes certain data.

      I added a debug output to SkinType#getSkin, which shows the following (manually commented) in the JBoss server log:

      #login page is loaded
      #login action, main page gets loaded
      #at some point during the main page loading, new conversations are opened

      The resulting page is a mix of images from the SKIN1 skin and CSS files from the DEFAULT skin.

      Are conversation scoped skins not supported in Seam, or got I just the configuration wrong?

      Thanks in advance,

      Seam 2.2.1.CR2, RichFaces 3.3.3.Final

      Configuration and backing bean:

      <!-- web.xml -->

      <!-- pages.xml -->
      <page view-id="/login.xhtml" login-required="false">
          <rule if="#{identity.loggedIn}">
            <begin-conversation join="true" />
            <redirect view-id="/index.xhtml" />

      public class SkinState implements Serializable {
        private SkinType skin = SkinType.DEFAULT; // the skin type when not logged in
        public void setSkin(SkinType skin) {
          this.skin = skin;
        public String getSkin() {
          Conversation c = Conversation.instance();
          System.out.println("Conversation[" + c.getParentId() + ":" + c.getId() + ":" + skin + "]");
          return skin.name;