5 Replies Latest reply on Jan 19, 2011 1:14 PM by Sean Jensen

    Skinnability issues

    Sean Jensen Newbie

      I've been building an app from the seamgen standard build using jboss-5.1.0.GA, jboss-seam-2.2.0.GA and the RichFaces version that came with the download.  I was modifying the Seam Web Project that I created so that I could change the skins using a drop down menu.  All was well at first.  I was happy with my work and went on to the next task.  However I noticed that occasionally I was not getting the css styling when I would access the application in my browser.  I undid the changes I had made to the system and still was not getting the styling to show up unless I changed the style using my new menu and even then the content would by styled but my menu would not.  I also got inconsistent styling of components in the menu when it was styled; for example the menu would be styled but the drop down list would not be.  I even switched to another app I created and attempted to reproduce my issues after modifying 3 files I started to get the results I was getting before.  Could someone enlighten me as to the proper way of changing skins at runtime?  These are the changes I made:


      I added:
             


      <component name="skinBean">
                      <property name="skin">deepMarine</property>
              </component>




      to my components.xml.


      I added a context param in my web.xml:



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





      I also modified my pages.xml to require login for all pages:



       <page view-id="*" login-required="true">
        <navigation>
         <rule if-outcome="home">
          <redirect view-id="/home.xhtml"/>
         </rule>
        </navigation>
       </page>





      I created the SkinBean and interface and modified my menu to call the setSkin(xxx) method which seems to be functioning:



                      <rich:menuItem>
                              <s:link id="theme8" includePageParams="false" propagation="none" value="deepMarine" action="#{skinBean.setSkin('deepMarine')}"/>
                      </rich:menuItem>




       


      If I could just get the styling to come up properly initially and not lose it's parts then my modifications to make the changes should be ok.


        • 1. Re: Skinnability issues
          Alexandr Areshchanka Newbie

          This is not Seam question but richfaces, see skinning for example here:


          My Link

          • 2. Re: Skinnability issues
            Sean Jensen Newbie

            Thank you for the link but I've been through that and there is nothing there that I'm not addressing.  My concern is that when I wasn't doing the skin switching and would just start the server and access the page there was no problem.  However as soon as I made the above changes there started to be issues.  I would start the server and hit the page.  If I was forcing login I would get the un-styled version of the login page, if I was not forcing login then I would get an un-styled menu and styled content.  I could then change my skin and would get both the menu and the content styled... usually. 
            I'm not an expert but when the styles change during runtime and render correctly then my richfaces must be working correctly.  If there is an issue with richfaces then it must be a problem with the interaction of seam/jboss/richfaces in combination.
            Rather than refer me somewhere else could you look at my code and tell me where I've made an error or if it looks correct say so.  Believe me when I tell you I have not just posted spontaneously.  I looked at several forums and read every resource manual I could find but either the situation was different or I was told it's not richfaces or it's not seam or it's not jBoss.  I'm sure I'm not the only one who has had this problem and I wish I had found the solution but I haven't so I'm asking.
            Please forgive my frustration but I could use some guidance.

            • 3. Re: Skinnability issues
              Alexandr Areshchanka Newbie

              Sorry, it seems to me that issues is with scopes of beans that store skin preferences, if values are stored in session scope bean after logout\session timeout values are lost and none skin is loaded.


              You should implement some mechanism of storing skin selection and default skin if none or null value.


              I would suggest to store skin selection in cookies. Try to implement same as I provided in the link above but in bean load skin value from cookies and not store it in session or map.


              Regards, Alex.

              • 4. Re: Skinnability issues
                Alexandr Areshchanka Newbie

                Also if some styles are load partially try to add


                <context-param>
                          <param-name>org.richfaces.LoadStyleStrategy</param-name>
                          <param-value>ALL</param-value>
                     </context-param>


                to web.xml

                • 5. Re: Skinnability issues
                  Sean Jensen Newbie

                  Thank you very much for your help.  I'll attempt to implement your suggestion.
                  Again I apologize for my frustration and appreciate your reply.