10 Replies Latest reply on Sep 21, 2007 12:41 PM by phillidl

    Installation Help -- JavaScript

    phillidl

      Disclaimer: I know this is a pitiful newbie question, but I can't find the answer on the forum or in the install instructions. Here it is: I've installed RichFaces into my project, including the web.xml filter, but when I fire up my app, none of the javascript libraries are being included on my page. That is, when I try to create a tree component (the reason for which I downloaded RichFaces), I get a "Tree is not defined" javascript error when hitting my page. I tried the basic echo page mentioned in the install guide, and it renders the "Simple Echo" tag and input box as expected, but the onkeyup event throws an "A4J is not defined" javascript error.

      The relevant portion of the web.xml is:

      <context-param>
       <param-name>org.richfaces.SKIN</param-name>
       <param-value>blueSky</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>
      


      RichFaces tags are being rendered, but the javascript libraries are not being included. Can anyone see what I'm doing wrong?


        • 1. Re: Installation Help -- JavaScript

          web.xml is good.

          What is in your run-time environment?

          • 2. Re: Installation Help -- JavaScript
            phillidl

            I'm publishing to WebSphere Application Server 6.1, on Windows 2000. I'm in the process of trying to publish to Tomcat as well, just for testing.

            • 3. Re: Installation Help -- JavaScript
              phillidl

              Update: I've just published to Tomcat 5.5.25, with the same results: RichFaces tags render appropriate HTML, but the javascript libraries that drive them aren't included.

              • 4. Re: Installation Help -- JavaScript

                Do you have apache server in front ?

                • 5. Re: Installation Help -- JavaScript
                  phillidl

                  No, just the app server.

                  • 6. Re: Installation Help -- JavaScript

                    do you have some small war we can test on our side?

                    • 7. Re: Installation Help -- JavaScript
                      phillidl

                      Working on it, but my app was pretty heavy to start with, so it's taking me a bit to dummy one up.

                      In the meantime, I noticed that I don't actually find any Filter class in the org.ajax4jsf package in any of the three jars I downloaded. (I'm using 3.1.0, btw.) I did find it in the older 3.0.1 version. Is that my problem; that I'm trying to use a class that has been removed from the install package?

                      • 8. Re: Installation Help -- JavaScript
                        phillidl

                        False alarm on the absence of the Filter class. I downloaded 3.1.0 again and overwrote the jars that I had, and now it's there. I had a corrupt jar somehow.

                        Anyway, I've done more testing, and it seems to be a conflict between RichFaces and IBM's Extended Faces Support. My faces-config.xml file looks like this:

                        <?xml version="1.0"?>
                        
                        <!DOCTYPE faces-config PUBLIC
                         "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
                         "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
                        
                        <!-- =========== FULL CONFIGURATION FILE ================================== -->
                        
                        <faces-config>
                         <application>
                         <state-manager>
                         com.ibm.faces.application.DevelopmentStateManager</state-manager>
                         <property-resolver>
                         com.ibm.faces.databind.SelectItemsPropResolver</property-resolver>
                         <variable-resolver>
                         com.ibm.faces.databind.SelectItemsVarResolver</variable-resolver>
                         </application>
                         <factory>
                         <faces-context-factory>
                         com.ibm.faces.context.AjaxFacesContextFactory</faces-context-factory>
                         <render-kit-factory>
                         com.ibm.faces.renderkit.AjaxRenderKitFactory</render-kit-factory>
                         </factory>
                         <managed-bean>
                         <managed-bean-name>pc_Echo</managed-bean-name>
                         <managed-bean-class>org.ah.questionairre.pagecode.Echo</managed-bean-class>
                         <managed-bean-scope>request</managed-bean-scope>
                         </managed-bean>
                         <lifecycle>
                         <phase-listener>
                         com.ibm.faces.webapp.ValueResourcePhaseListener</phase-listener>
                         </lifecycle>
                        </faces-config>
                        


                        With the bolded lines included, RichFaces javascript libraries don't load. Without those lines, RichFaces works as expected. Obviously, I'd like to keep those lines, so that certain other IBM components can continue to use AJAX. Does anyone have any ideas about a workaround I might try, like the Facelets ViewHandler config mentioned in Chapter 4 of the developer's guide?

                        • 9. Re: Installation Help -- JavaScript

                          We have not been reported about such problem previously.

                          The situation with ViewHandlers in JSF is pretty clear. The order of them is important.

                          In general, RichFaces does not limit you with using RenderKit. It just does not work on this level and leave the set RenderKit as is. However, if some RenderKit plays not only the rule of specific rendering for existing components, but starts to manage other aspects, like a resource management, for example , the conflicts become possible.

                          As I said before, we have not been reported about any conflict with com.ibm.faces.renderkit.AjaxRenderKitFactory. So, I cannot say anything in particular right now.

                          http://jira.jboss.com/jira/browse/RF-983 has been created for further investigation.

                          • 10. Re: Installation Help -- JavaScript
                            phillidl

                            Thanks. I've attached a small WAR to the jira ticket, in case that helps.