12 Replies Latest reply on Sep 18, 2012 9:55 AM by Rudresh M R

    Disable Richfaces 4 styles

    jattra Newbie

      Hello, please help me disable richfaces built-in styles (skin).

      I tried to add these to web.xml:

       

          <context-param>

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

              <param-value>plain</param-value>

          </context-param>

       

          <context-param>

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

              <param-value>disable</param-value>

          </context-param>

       

      ... but neither worked. I like RF skin but I want to create my own

       

      Thanks for help.

        • 1. Disable Richfaces 4 styles
          Ilya Sorokoumov Master

          I looked at showcase application it I didn't find plain skin.

          http://anonsvn.jboss.org/repos/richfaces/branches/4.0.0.M5/examples/richfaces-showcase/src/main/java/org/richfaces/demo/common/SkinBean.java

          I'm afraid that skins disabling has not been done yet.

          But you can look at this link:

          http://docs.jboss.org/richfaces/nightly_4_0_X/Developer_Guide/en-US/html_single/#chap-Developer_Guide-Skinning_and_theming

          And the plain skin is present in this documentation. So I think that you should wait for the answer from RF team.

           

          Could you post yout RF version, app server etc.?

          • 2. Disable Richfaces 4 styles
            jattra Newbie

            Thanks for quick response.

             

            I am using:

            <webflow.version>2.2.1.RELEASE</webflow.version>

            <jsf.version>2.0.3</jsf.version>

            <richfaces.version>4.0.0.20101226-M5</richfaces.version>

             

            and testing on jetty plugin 7.1.6.v20100715

             

            The app is supposed to run on Tomcat6.

            • 3. Disable Richfaces 4 styles
              Nick Belaevski Master

              Hi,

               

              There are still issues with 'plain' skin support: https://issues.jboss.org/browse/RF-9613.

              • 4. Re: Disable Richfaces 4 styles
                u j Novice

                I tried

                 

                <context-param>

                 

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

                 

                        <param-value>plain</param-value>

                 

                    </context-param>

                 

                and the skinning seems to be disabled, but I get

                 

                14:44:21,584 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/myapp].[Faces Servlet]] Servlet.service() para servlet Faces Servlet lanzó excepción: java.lang.IllegalArgumentException: Width (2000) and height (0) cannot be <= 0

                 

                    at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999) [:1.6.0_24]

                 

                    at java.awt.image.BufferedImage.<init>(BufferedImage.java:321) [:1.6.0_24]

                 

                    at org.richfaces.resource.ImageType.createARGBImage(ImageType.java:103) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.ImageType.access$200(ImageType.java:34) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.ImageType$2.createImage(ImageType.java:44) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.ImageType.createImage(ImageType.java:118) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.Java2DUserResourceWrapperImpl.paintAndWrite(Java2DUserResourceWrapperImpl.java:155) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.Java2DUserResourceWrapperImpl.getInputStream(Java2DUserResourceWrapperImpl.java:65) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.CachedResourceImpl.initialize(CachedResourceImpl.java:178) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:171) [:4.0.0-SNAPSHOT]

                 

                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:407) [:2.1.1-FCS]

                 

                14:45:38,493 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/myapp].[Faces Servlet]] Servlet.service() para servlet Faces Servlet lanzó excepción: java.lang.IllegalArgumentException: Width (1) and height (0) cannot be <= 0

                 

                    at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999) [:1.6.0_24]

                 

                    at java.awt.image.BufferedImage.<init>(BufferedImage.java:321) [:1.6.0_24]

                 

                    at org.richfaces.resource.ImageType.createARGBImage(ImageType.java:103) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.ImageType.access$200(ImageType.java:34) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.ImageType$2.createImage(ImageType.java:44) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.ImageType.createImage(ImageType.java:118) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.Java2DUserResourceWrapperImpl.paintAndWrite(Java2DUserResourceWrapperImpl.java:155) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.Java2DUserResourceWrapperImpl.getInputStream(Java2DUserResourceWrapperImpl.java:65) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.CachedResourceImpl.initialize(CachedResourceImpl.java:178) [:4.0.0-SNAPSHOT]

                 

                    at org.richfaces.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:171) [:4.0.0-SNAPSHOT]

                 

                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:407) [:2.1.1-FCS]

                 

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]

                 

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]

                 

                    at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [:6.0.0.Final]

                 

                I couldn't find an open issue with that.

                 

                In Google I found a note

                http://echelog.matzon.dk/logs/browse/richfaces/1306706400

                 

                Thanks

                • 5. Re: Disable Richfaces 4 styles
                  Ivan Sundt Newbie

                  Did you figure this out? I have the exact same problem. Seems to be happening if the view has a calendar component.

                  • 6. Re: Disable Richfaces 4 styles
                    u j Novice

                    No, I changed back to default. I guess it is a bug, but I was too lazy to report it

                    • 7. Re: Disable Richfaces 4 styles
                      u j Novice

                      I got around to create the bug:

                      https://issues.jboss.org/browse/RF-11103

                      • 8. Re: Disable Richfaces 4 styles
                        u j Novice

                        A fix to avoid the exceptions is: copy source file org.richfaces.resource.ImageType.java into your project and add the if clause:

                         

                        private static BufferedImage createARGBImage(int width, int height) {

                                    if (height == 0) {

                                        height = 1;

                                    }

                                return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);

                        }

                        • 9. Re: Disable Richfaces 4 styles
                          Saroj Padhy Novice

                          For Richfaces4, to disable  skinning we have to use parameters as below:

                           

                              <context-param>
                                  <param-name>org.richfaces.skin</param-name>
                                  <param-value>plain</param-value>
                              </context-param>
                              <context-param>
                                  <param-name>org.richfaces.enableControlSkinning</param-name>
                                  <param-value>false</param-value>
                              </context-param>
                          

                           

                          source: http://docs.jboss.org/richfaces/nightly_4_0_X/Developer_Guide/en-US/html_single/#sect-Developer_Guide-Skinning_and_theming-Skinning_standard_controls

                           

                          Thanks,

                          Saroj

                          • 10. Re: Disable Richfaces 4 styles
                            u j Novice

                            You are right, thanks.

                            It could be made more robust to avoid such misleading exceptions.

                            • 11. Re: Disable Richfaces 4 styles
                              u j Novice

                              As commented in the bug

                               

                              https://issues.jboss.org/browse/RF-11103

                               

                              the exception ocurrs again, even with the context parameters set.

                              • 12. Re: Disable Richfaces 4 styles
                                Rudresh M R Newbie

                                i tried setting heght to 1, but it stilll throwing the same exception, please let me know how it resolved,