14 Replies Latest reply on Mar 19, 2009 12:35 PM by cmathrusse

    Buttons not rendering with skin

    cmathrusse

      I'm having a bit of trouble getting my <a4j:commandButton> to render correctly based upon the skin that I have selected. I've followed the developer guide pertaining to skinning my application, and it appears to work correctly. (I tested this by selecting a different skin in web.xml and the UI reflected the change)

      The problem I have is simply the commandButton. I have it defined as follows:

      <a4j:commandButton type="button" value="..." action="..."
       onClick="this.disabled=true" onComplete="this.disabled=false" />
      


      I would expect the button to render in a fashion similar to the demo application, but what I end up with is the standard default grey button.

      Any suggestions?

      Thanks for the help....

        • 1. Re: Buttons not rendering with skin
          thiruneela

          Try adding the following code to your web.xml and restart the server once.

           <context-param>
           <param-name>org.richfaces.CONTROL_SKINNING</param-name>
           <param-value>enable</param-value>
           </context-param>
           <context-param>
           <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
           <param-value>enable</param-value>
           </context-param>
          


          • 2. Re: Buttons not rendering with skin
            cmathrusse

            Thanks for the suggestion. I already had the org.richfaces.CONTROL_SKINNING=enabled specified in my web.xml but not the other. I added it but the result was the same. The buttons get rendered in the default grey color with no skin applied.

            • 3. Re: Buttons not rendering with skin
              nbelaevski

              What browser do you use?

              • 4. Re: Buttons not rendering with skin

                try to add it to your web.xml

                <context-param>
                 <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
                 <param-value>true</param-value>
                 </context-param>
                


                • 5. Re: Buttons not rendering with skin

                  sorry, false copied. should be

                   <context-param>
                   <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                   <param-value>true</param-value>
                   </context-param>
                  


                  • 6. Re: Buttons not rendering with skin
                    ilya_shaikovsky

                    What about browser? And could you please check with firebug the CSS files loaded and the classes applied to the button?

                    • 7. Re: Buttons not rendering with skin
                      cmathrusse

                      I'm using both IE7 and FireFox 3.0.7. I currently have in my web.xml file the following:

                      <context-param>
                       <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                       <param-value>enabled</param-value>
                       </context-param>
                       <context-param>
                       <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
                       <param-value>enabled</param-value>
                       </context-param>
                      


                      I've tried google on this issue and have come up with nothing that will make the buttons skin as in the demo application. The only thing that I have different is that I am using facelets. I have no idea if this could be causing an issue or not so I thought that I would mention it.

                      Thanks for the help...

                      • 8. Re: Buttons not rendering with skin
                        nbelaevski

                        What doctype do you use?

                        • 9. Re: Buttons not rendering with skin
                          cmathrusse

                          I'm assuming that you are referring to the doc type of the page?

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


                          Here are the rest of my web.xml:

                           <context-param>
                           <param-name>com.sun.faces.verifyObjects</param-name>
                           <param-value>false</param-value>
                           </context-param>
                           <context-param>
                           <param-name>com.sun.faces.validateXml</param-name>
                           <param-value>true</param-value>
                           </context-param>
                           <context-param>
                           <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                           <param-value>.xhtml</param-value>
                           </context-param>
                           <context-param>
                           <param-name>facelets.DEVELOPMENT</param-name>
                           <param-value>false</param-value>
                           </context-param>
                           <context-param>
                           <param-name>facelets.SKIP_COMMENTS</param-name>
                           <param-value>true</param-value>
                           </context-param>
                           <context-param>
                           <param-name>org.richfaces.SKIN</param-name>
                           <param-value>blueSky</param-value>
                           </context-param>
                           <context-param>
                           <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                           <param-value>com.sun.facelets.FaceletViewHandler</param-value>
                           </context-param>
                           <context-param>
                           <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
                           <param-value>TIDY</param-value>
                           </context-param>
                           <context-param>
                           <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                           <param-value>enabled</param-value>
                           </context-param>
                           <context-param>
                           <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
                           <param-value>enabled</param-value>
                           </context-param>
                          
                          
                           <filter>
                           <display-name>RichFaces Filter</display-name>
                           <filter-name>richfaces</filter-name>
                           <filter-class>org.ajax4jsf.Filter</filter-class>
                           </filter>
                           <filter-mapping>
                           <filter-name>richfaces</filter-name>
                           <servlet-name>Faces Servlet</servlet-name>
                           <dispatcher>REQUEST</dispatcher>
                           <dispatcher>FORWARD</dispatcher>
                           <dispatcher>INCLUDE</dispatcher>
                           </filter-mapping>
                          
                           <listener>
                           <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
                           </listener>
                          
                           <servlet>
                           <servlet-name>Faces Servlet</servlet-name>
                           <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                           <load-on-startup>1</load-on-startup>
                           </servlet>
                           <servlet-mapping>
                           <servlet-name>Faces Servlet</servlet-name>
                           <url-pattern>*.jsf</url-pattern>
                           </servlet-mapping>
                          
                           <session-config>
                           <session-timeout>30</session-timeout>
                           </session-config>
                           <welcome-file-list>
                           <welcome-file>index.html</welcome-file>
                           </welcome-file-list>
                          




                          • 10. Re: Buttons not rendering with skin
                            nbelaevski

                            Can you please save page as MHT file and post it somewhere (e.g. sendspace)?

                            • 11. Re: Buttons not rendering with skin
                              cmathrusse

                              I've placed the file in my dropbox. You should be able to access it with the following URL:

                              http://dl.getdropbox.com/u/601181/Sybase%20Export%20Control%20Verification.mht


                              Thanks again for the help...

                              • 12. Re: Buttons not rendering with skin
                                nbelaevski

                                I've looked at the file posted. Strangely, there's nothing about skinning...

                                • 13. Re: Buttons not rendering with skin
                                  nbelaevski

                                  Ok, I've rechecked web.xml, sorry for not noticing this earlier: value should be

                                  <context-param>
                                   <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                                   <param-value>enable</param-value>
                                   </context-param>
                                  and not enabled nor true

                                  • 14. Re: Buttons not rendering with skin
                                    cmathrusse

                                    DOH!!!! I can't believe I wasted so much time over this issue and didn't even see the typo.

                                    Thanks so much for the patience and finding the resolution for me.