7 Replies Latest reply on Nov 19, 2008 4:11 AM by ilya_shaikovsky

    Skins Not Applied To Buttons

      I am using RichFaces 3.2.0 with Seam, and I am using multiple components with the classic skin. Everything works just fine with the components, but my h:commandButton's are not being skinned. They simply look gray with black letters as is typical.

      Here is my web.xml:


      <?xml version='1.0' encoding='UTF-8'?>
      <web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>server</param-value>
       </context-param>
       <context-param>
       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
       <param-value>.jspx</param-value>
       </context-param>
       <context-param>
       <param-name>org.richfaces.SKIN</param-name>
       <param-value>classic</param-value>
       </context-param>
       <!-- Seam -->
       <listener>
       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
       </listener>
       <listener>
       <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
       </listener>
       <filter>
       <filter-name>Seam Filter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>Seam Filter</filter-name>
       <url-pattern>/*</url-pattern>
       </filter-mapping>
       <servlet>
       <servlet-name>Seam Resource Servlet</servlet-name>
       <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
       </servlet>
       <servlet-mapping>
       <servlet-name>Seam Resource Servlet</servlet-name>
       <url-pattern>/seam/resource/*</url-pattern>
       </servlet-mapping>
       <!-- Faces Servlet -->
       <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>*.html</url-pattern>
       </servlet-mapping>
       <session-config>
       <session-timeout>10</session-timeout>
       </session-config>
      </web-app>
      


      Any help you can give me to skin my buttons is much appreciated.

      Thanks.

        • 1. Re: Skins Not Applied To Buttons
          fernando_jmt

          You must also add this context-param:

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


          HTH.


          • 2. Re: Skins Not Applied To Buttons

            Thanks. That worked.

            Now I have a follow-up:

            Is there a way to specify exemptions? In other words, if I want to exempt a control from skinning, can I specify that on an individual basis?

            Thanks.

            • 3. Re: Skins Not Applied To Buttons

              I forgot to clarify...I basically only want to skin my buttons and selects. Nothing else.

              Thanks.

              • 4. Re: Skins Not Applied To Buttons
                ilya_shaikovsky

                You could

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

                So all the components will not be skinned. Only the components which containers has styleClass="rich-container".
                So using next code with these params defined in web.xml:
                 <rich:modalPanel id="panel" width="300" height="230">
                 <f:facet name="header">
                 Standard components skinning
                 </f:facet>
                 <i>
                 All the controls below is just standard JSF components skinned with Rich Faces:
                 </i>
                 <hr/>
                 <h:panelGrid columns="2" styleClass="rich-container">
                 <h:outputText value="Enter Name:"/>
                 <h:inputText/>
                 <h:outputText value="Enter you interests:"/>
                 <h:inputTextarea/>
                 <h:outputText value="Choose your favourite color"/>
                 <h:selectOneMenu>
                 <f:selectItem itemLabel="Red"/>
                 <f:selectItem itemLabel="Black"/>
                 <f:selectItem itemLabel="Green"/>
                 <f:selectItem itemLabel="White"/>
                 </h:selectOneMenu>
                 </h:panelGrid>
                 <hr/>
                 <button type="button" onclick="#{rich:component('panel')}.hide()">Hide this example</button>
                 </rich:modalPanel>


                only controls inside panelGrid will be skinned. And the button remains without changes.

                • 5. Re: Skins Not Applied To Buttons
                  ilya_shaikovsky

                  additionally if you could not use container and still want to apply classes only to separate components read there http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/devguide/en/html/ArchitectureOverview.html#StControlsSkinning

                  about special classes like rich-select which you could apply by yourself to every select when using the context params I've mentioned before.

                  • 6. Re: Skins Not Applied To Buttons
                    b_ravi_kiran

                    Even if I put the following in my web.xml - IE6.0.2900 does not put proper colors on buttons (buttons are still grey). However, Firefox works correctly

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

                    • 7. Re: Skins Not Applied To Buttons
                      ilya_shaikovsky

                      seems just cache problem in your IE.