4 Replies Latest reply on Nov 19, 2009 4:39 PM by valatharv

    Richfaces styles not loading consistently

    cc_humbry

      Hi, I am asking this question here instead of the RichFaces forums as the configuration details found here http://docs.jboss.org/seam/2.1.1.GA/reference/en-US/html/configuration.html suggest that there is no need to add RichFaces specific configuration in web.xml.



      If RichFaces is used in your project, Seam will install the RichFaces Ajax filter for you, making sure to install it before all other built-in filters. You don't need to install the RichFaces Ajax filter in web.xml  yourself.

      The RichFaces Ajax filter is only installed if the RichFaces jars are present in your project.

      I have an issue where some of my RichFaces controls - toolbar, panel lose a lot of their styling. Header background, fonts etc.


      When I look at the generated source code, I see that there are stylesheet links such as this


      <link class='component' href='/behindbars/a4j/s/3_3_0.GAcss/panel.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__' rel='stylesheet' type='text/css'>"


      Pasting the url into the browser just displays a blank page. Other links such as this


      <link class="component" href="/behindbars/a4j/s/3_3_0.GAcss/tabPanel.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css">


      display appropriate styles. Unsurprisingly my TabPanel looks OK.


      This is extremely frustrating. Can anyone suggest anything to fix this?? I have seen a couple of forums threads that appear to be similar, some suggesting it is to do with security of pages and others around adding various other bits to the web.xml, but as I have lifted my web.xml directly from the docs, I can't see that this is anything other than a bug.



      I am using Seam 2.1.1GA and RichFaces 3.3.0.GA on GlassFish.


      my web.xml looks like this


      <?xml version="1.0" encoding="UTF-8"?>
      <web-app id="WebApp_ID" version="2.5"
              xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      
      <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>*.seam</url-pattern>
      </servlet-mapping>
      
      <listener>
          <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
      </listener>
      
      <context-param>
          <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
          <param-value>.xhtml</param-value>
      </context-param>
      
      <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>
      
      <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>
      
          <context-param>
              <param-name>org.richfaces.SKIN</param-name>
              <param-value>blueSky</param-value>
          </context-param>
      
      
      </web-app>
      


        • 1. Re: Richfaces styles not loading consistently
          cc_humbry

          Contrary to my earlier comment about security not being an issue here, it appears that if I take of securing all my pages with this line in my pages.xml


          <page view-id="/*" login-required="true" />
          



          then the panel styling reappears. Why does some styling show and not others???


          Thanks
          Conrad

          • 2. Re: Richfaces styles not loading consistently
            wangliyu
            This is a long term issue, Pete refer to RichFace team, and it seems still not fixed in 3.3.1GA, anyway, you can put the secure part into a special folder, and for that folder use login-required="true", don't use it at the level that contains the styles files (.xcss)
            • 3. Re: Richfaces styles not loading consistently
              dgriffin

              I have a simple solution that worked for me. In my case most of the time the CSS for rich:calendar and h:commandButton was not loading properly. The solution was removing some entries from web.xml that seamgen created and replacing them with some other entries.


              I see no way to post XML or attach a file.  If someone can explain how to do that I will post the solution.

              • 4. Re: Richfaces styles not loading consistently
                valatharv

                You can try

                backticks

                Please cleck on help button for details, else copy and paste web.xml


                contents of web.xml