10 Replies Latest reply on Oct 19, 2009 3:21 AM by zlatko99

    Rendering problem with Richfaces 3.3.0.GA

    zlatko99

      Hi all,

      I'm developing a Seam 2.2.0 application incorporating richfaces 3.3.0 components on JBoss 5.1.0. For now, I have only one <rich:combobox> defined as following:

      <rich:comboBox defaultLabel="Enter some value">
       <f:selectItem itemValue="suggestion 1"/>
       <f:selectItem itemValue="suggestion 2"/>
       <f:selectItem itemValue="suggestion 3"/>
       <f:selectItem itemValue="suggestion 4"/>
       <f:selectItem itemValue="suggestion 5"/>
      </rich:comboBox>
      


      with properly defined "rich" namespace
      (xmlns:rich="http://richfaces.org/rich")

      The packed and deployed EAR project structure is:

      +META-INF
       -application.xml
       -jboss-app.xml
       -mysql-ds.xml
      +lib
       -jboss-el.jar
       -jboss-seam.jar
       -richfaces-api-3.3.0.GA.jar
      +web
       +WEB-INF
       -classes
       +lib
       -richfaces-impl-3.3.0.GA
       -richfaces-ui-3.3.0.GA
       -.....
       -faces-config.xml
       -components.xml
       -pages.xml
       -web.xml
      


      The problem is: everything I get from this <rich:combobox> tag is 3 text fields one under the other, and the first one says "Enter some value"...
      I tried with different versions of richfaces, tried other tags, tried setting various context parameters in web.xml (for skin and xml parser), but to no avail.

      What could be the cause for this behaviour? Maybe duplicate or not compatible jar files?

      Looking forward to hear.
      Thanks in advance,
      Zlatko

        • 1. Re: Rendering problem with Richfaces 3.3.0.GA
          nbelaevski

          Hi Zlatko,

          Check that f:* prefix is correctly declared on the page.

          • 2. Re: Rendering problem with Richfaces 3.3.0.GA
            zlatko99

            Hi Nick,

            thanks for trying to help me. Actually, the f:* prefix is correctly declared. This is the namespacing segment:

            <html xmlns="http://www.w3.org/1999/xhtml"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:a4j="http://richfaces.org/a4j"
             xmlns:rich="http://richfaces.org/rich">
            


            Any other suggestions?

            Zlatko

            • 3. Re: Rendering problem with Richfaces 3.3.0.GA
              nbelaevski

              Ok, this may happen if CSS/JS resources haven't been loaded. Two things to check: presence of RF resources links in the generated HTML code (they are located in HEAD tag) and if it's ok then clear browser cache and check if they are loaded correctly using Firebug tool "Net" tab.

              • 4. Re: Rendering problem with Richfaces 3.3.0.GA
                zlatko99

                This is my HEAD section (from the page source in browser with cleared cache):

                <head>
                 <link class="component" href="/seam1Web/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__;jsessionid=3E87A47E6F5C93634E3E815BD590D756" rel="stylesheet" type="text/css" />
                 <link class="component" href="/seam1Web/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/extended_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__;jsessionid=3E87A47E6F5C93634E3E815BD590D756" media="rich-extended-skinning" rel="stylesheet" type="text/css" />
                 <script src="/seam1Web/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.PrototypeScript" type="text/javascript"></script><script src="/seam1Web/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/jquery/jquery.js" type="text/javascript"></script>
                 <script src="/seam1Web/a4j/g/3_3_0.GAscripts/comboboxUtils.js" type="text/javascript"></script><script src="/seam1Web/a4j/g/3_3_0.GAscripts/combolist.js" type="text/javascript"></script>
                 <script src="/seam1Web/a4j/g/3_3_0.GAscripts/combobox.js" type="text/javascript"></script><script src="/seam1Web/a4j/g/3_3_0.GAscripts/comboboxstyles.js" type="text/javascript"></script>
                 <script src="/seam1Web/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/utils.js" type="text/javascript"></script>
                 <link class="component" href="/seam1Web/a4j/s/3_3_0.GAcss/combobox.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__;jsessionid=3E87A47E6F5C93634E3E815BD590D756" rel="stylesheet" type="text/css" />
                 <script type="text/javascript">window.RICH_FACES_EXTENDED_SKINNING_ON=true;</script><script src="/seam1Web/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/skinning.js" type="text/javascript"></script>
                 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                </head>
                


                Still, the component doesn't look right. But, as far as I was able to see in Firebug, the CSS resources are loaded by a GET request, and the response content of that request is:

                .dr-pnl{border-width:1px;border-style:solid;padding:1px;}.dr-pnl-h{padding:2px;border-width:1px;border-style:solid;background-position:top left;background-repeat:repeat-x;}.dr-pnl-b{padding:10px;}.dr-pnl{background-color:#FFF;border-color:#BED6F8;}.dr-pnl-h{background-color:#BED6F8;border-color:#BED6F8;font-size:11px;color:#000;font-weight:bold;font-family:Arial,Verdana,sans-serif;background-image:url(/seam1Web/a4j/g/3_3_0.GAorg.richfaces.renderkit.html.GradientA/DATB/eAH7!!3Tj2v7mAAZZAV3);}.dr-pnl-b{font-size:11px;color:#000;font-family:Arial,Verdana,sans-serif;}
                


                However, no GET request for the java scripts. What could be the problem?

                Thank you,
                Zlatko

                • 5. Re: Rendering problem with Richfaces 3.3.0.GA
                  nbelaevski

                  Zlatko,

                  HTML code looks ok and GET requests should happen, please try clearing browser cache or maybe you have turned on filtering for CSS resources in Firebug.

                  • 6. Re: Rendering problem with Richfaces 3.3.0.GA
                    zlatko99

                    Nick,

                    I succeeded to see all the resource GET requests in Firebug. There were 14 of them (including the invocation of the .seam page). Firebug showed no cached content (I cleared the cache before accessing the page). However, the look of the component remained the same: three text fields one under the other. Here are the requests:


                    http://localhost:8080/seam1Web/test.seam
                    http://localhost:8080/seam1Web/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__
                    http://localhost:8080/seam1Web/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/extended_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__
                    http://localhost:8080/seam1Web/a4j/s/3_3_0.GAcss/panel.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__
                    http://localhost:8080/seam1Web/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.PrototypeScript
                    http://localhost:8080/seam1Web/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/jquery/jquery.js
                    http://localhost:8080/seam1Web/a4j/g/3_3_0.GAscripts/comboboxUtils.js
                    http://localhost:8080/seam1Web/a4j/g/3_3_0.GAscripts/combolist.js
                    http://localhost:8080/seam1Web/a4j/g/3_3_0.GAscripts/combobox.js
                    http://localhost:8080/seam1Web/a4j/g/3_3_0.GAscripts/comboboxstyles.js
                    http://localhost:8080/seam1Web/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/utils.js
                    http://localhost:8080/seam1Web/a4j/s/3_3_0.GAcss/combobox.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__
                    http://localhost:8080/seam1Web/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/skinning.js
                    http://localhost:8080/seam1Web/a4j/g/3_3_0.GAimages/spacer.gif


                    I will also include my web.xml:
                    <?xml version="1.0" encoding="UTF-8"?>
                    <web-app 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"
                     version="2.5">
                    
                     <context-param>
                     <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                     <param-value>com.sun.facelets.FaceletViewHandler</param-value>
                     </context-param>
                    
                     <!-- Seam -->
                    
                     <listener>
                     <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                     </listener>
                    
                     <servlet>
                     <servlet-name>Seam Resource Servlet</servlet-name>
                     <servlet-class>org.jboss.seam.servlet.ResourceServlet</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>javax.faces.STATE_SAVING_METHOD</param-name>
                     <param-value>server</param-value>
                     </context-param>
                    
                     <context-param>
                     <param-name>facelets.DEVELOPMENT</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>org.richfaces.SKIN</param-name>
                     <param-value>blueSky</param-value>
                     </context-param>
                    
                     <!--
                     <context-param>
                     <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
                     <param-value>TIDY</param-value>
                     </context-param>
                     -->
                    
                    
                     <servlet>
                     <servlet-name>Faces Servlet</servlet-name>
                     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                     <load-on-startup>1</load-on-startup>
                     </servlet>
                    
                     <!-- Faces Servlet Mapping -->
                     <servlet-mapping>
                     <servlet-name>Faces Servlet</servlet-name>
                     <url-pattern>*.seam</url-pattern>
                     </servlet-mapping>
                    
                    </web-app>
                    


                    I even turned off all the caching and tried the page in many browsers, but to no avail. I started getting really frustrated with this problem :S


                    Zlatko

                    • 7. Re: Rendering problem with Richfaces 3.3.0.GA
                      nbelaevski

                      Zlatko,

                      Have you checked contents of these resources? I see that URIs are not correct, because they should include pattern of FacesServlet "*.seam", but this doesn't happen in your case. Also you can try checking with the latest 3.3.2.SR1 RF version.

                      • 8. Re: Rendering problem with Richfaces 3.3.0.GA
                        zlatko99

                        Nick,

                        finally, I have found the problem and the interesting part is that is not related to RichFaces. I decided to post the cause of the problem here, so anyone having this problem can find the resolution here.

                        Let me show first the simple contents of my Seam project. There are three .xhtml pages (mapped to .seam): index.xhtml, main.xhtml and test.xhtml. For the index.html, login is not required, as this page is the first one accessed. When the user is successfully logged on, it is redirected to main.xhtml (this page is not of interest, because it doesn't containts any richfaces components). index.xhtml and test.xhtml do contain <rich:combobox/> components.

                        The problem lies in the following pages.xml Seam file:

                        <pages login-view-id="/index.xhtml">
                        
                         <page view-id="*" login-required="true" />
                        
                         <page view-id="/index.xhtml" login-required="false" action="#{authenticator.redirect}">
                         <navigation>
                         <rule if="#{identity.loggedIn}">
                         <redirect view-id="/main.xhtml"/>
                         </rule>
                         <rule if-outcome="main">
                         <redirect view-id="/main.xhtml"/>
                         </rule>
                         </navigation>
                         </page>
                        </pages>
                        


                        Actually, the problem is the following element:
                        <page view-id="*" login-required="true" />
                        


                        When I commented this out, <rich:combobox/> on index.xhtml and test.xhtml started to show correctly.

                        What I can't understand yet is why the <rich:combobox/> component is not rendered right on the index.xhtml, when this page is excluded from login requirement (login-required="false"), and why was <rich:combobox/> component not rendered right on the test.xhtml, even if I logged succcessfully and accessed the test.seam afterwards. I will try experimenting to find the reasons for that.

                        However, thank you Nick for being with me through this problem and replying to my questions so fast. It's very appreciated.

                        Thanks,
                        Zlatko

                        • 9. Re: Rendering problem with Richfaces 3.3.0.GA
                          nbelaevski

                          Zlatko,

                          That's a known issue, please take a look: https://jira.jboss.org/jira/browse/RF-2316

                          • 10. Re: Rendering problem with Richfaces 3.3.0.GA
                            zlatko99

                            Thanks, Nick

                            unfortunately, I found out the hard way. But, this is a lesson for me in future to check out my problems first in JIRA database.

                            Zlatko