12 Replies Latest reply on Jun 5, 2012 3:13 PM by ncarrasco2006

    customize Richfaces Skin

      Hi,

       

      I am trying to create my own Richfaces skin but when displaying the page nothing happen and I got components without style;

       

      here is my web.xml :

       <context-param>
          <param-name>org.richfaces.skin</param-name>
          <param-value>my_skin</param-value>
        </context-param>
      
      

       

      and also I added my_skin.skin.properties (a copy from an existing skin in richfaces jars " wine.skin.properties) to my resources.

       

      I am using richfaces 4.2.1.

       

      Thanks in advance

        • 1. Re: customize Richfaces Skin
          iabughosh

          hello anis,

          your skin file must be at the root of your classpath, also make sure that your page contains h:head & h:body tags.

           

          regards.

          • 2. Re: customize Richfaces Skin

            thank you Ibrahim;

             

            It is in the classPath and it is also under META-INF/skins,

             

            and I added head and body to my page,

             

            <HEAD></HEAD>

            <BODY>

            ....

             

            </BODY>

             

            but no luck, is there any special thing I have to do?

             

            Thanks

            • 3. Re: customize Richfaces Skin
              iabughosh

              i mean h:head & h:body anis not head/body, try the following template :

               

              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

              <html xmlns="http://www.w3.org/1999/xhtml"

                    xmlns:h="http://java.sun.com/jsf/html"

                    xmlns:f="http://java.sun.com/jsf/core">

                  <h:head>      

                  </h:head>

                  <h:body>      

                  </h:body>

              </html>

               

              regards.

              • 4. Re: customize Richfaces Skin

                No luck,

                are you using richfaces 4.2.1 ?

                because i think that there are some issues with this, because even after I changed some color in the blueSky skin in the richfaces jar, it is not being changed in the application!!!

                • 5. Re: customize Richfaces Skin
                  iabughosh

                  yes, i'm using latest RF, did you include cssparser.jar,sac.jar & guava.jar in your WEB-INF/lib ?

                  • 6. Re: customize Richfaces Skin

                    In the example of richfaces web-app, that i used, there are an exclusion in the richfaces-core-impl :

                     

                    <exclusions>

                                    <exclusion>

                                        <artifactId>cssparser</artifactId>

                                        <groupId>net.sourceforge.cssparser</groupId>

                                    </exclusion>

                                    <exclusion>

                                        <artifactId>guava</artifactId>

                                        <groupId>com.google.guava</groupId>

                                    </exclusion>

                                </exclusions>

                    I delete it so i got those jar, but I am always getting same error,

                    but the way I tried to change the skin inside the jar (i changed the blueSky) but no changes happen !

                    • 7. Re: customize Richfaces Skin

                      Hi,

                       

                      These are steps I made,

                       

                      Create new Richfaces Project, then added my skin in the src folder --> failed

                      Create new Richfaces Project, then I changed the wine.skin.properties in the jar file --> no changes happend

                       

                      Sure I am modifing the property in the web.xml

                       

                      richfaces version 4.2.0.Final

                      Any ideas?

                      • 8. Re: customize Richfaces Skin

                        Can you please send me a sample example where you did customized the skin.

                        • 9. Re: customize Richfaces Skin
                          iabughosh

                          ok anis, i will send it when i arrive home.

                          • 10. Re: customize Richfaces Skin
                            iabughosh

                            anis, if you are using resourceMapping or resourceOptimization setted to true, you have to set it to false when you use custom skins.

                            • 11. Re: customize Richfaces Skin
                              nicolasdavyt1234

                              Hi, I'm trying with this and I have the same problem.

                               

                              I want to try  use  to extend the skin "classic" and now Im describing my steps

                               

                              1-Create de skin under WebContent/skins/myskin.skin.properties

                              2-Maped in web.xml

                               

                              <context-param>

                                  <param-name>org.richfaces.skin</param-name>

                                  <param-value>myskin</param-value> 

                              </context-param>

                               

                              3-Changes in my file myskin

                               

                              baseSkin=classic 

                              #Colors

                              headerBackgroundColor=#BED6F8

                              headerGradientColor=#F2F7FF

                              headerTextColor=#000000

                              headerWeightFont=bold

                               

                               

                              And don´t work ¿ any idea?

                              • 12. Re: customize Richfaces Skin

                                Hi,

                                 

                                I am also having problems extending a base skin. I seems to be a bug.

                                 

                                Bests,

                                Nicolás.