7 Replies Latest reply on Mar 16, 2007 1:23 PM by Sergey Smirnov

    'Richfaces' is undefined

    Dmitry Pinaev Newbie

      When I am calling for rich:modalPanel, I am getting a javascript error.
      The html page source does not seem to include any references to java script files.
      What should I do to fix the problem? Thanks!

        • 1. Re: 'Richfaces' is undefined
          Sergey Smirnov Master

          The Ajax4jsf filter configuration issue might be the case. So, what you have in the web.xml ?

          • 2. Re: 'Richfaces' is undefined
            Dmitry Pinaev Newbie

            Hi,

            <filter>
             <display-name>Ajax4jsf Filter</display-name>
             <filter-name>ajax4jsf</filter-name>
             <filter-class>org.ajax4jsf.Filter</filter-class>
            </filter>
            <filter-mapping>
             <filter-name>ajax4jsf</filter-name>
             <servlet-name>Faces Servlet</servlet-name>
             <dispatcher>FORWARD</dispatcher>
             <dispatcher>REQUEST</dispatcher>
             <dispatcher>INCLUDE</dispatcher>
            </filter-mapping>
            


            There seems to be nothing else related to the ajax4jsf. I am using facelets though, and for that I have

            <context-param>
             <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
             <param-value>com.sun.facelets.FaceletViewHandler</param-value>
            </context-param>
            


            • 3. Re: 'Richfaces' is undefined
              Sergey Smirnov Master

              It is OK, but it is important the correlations with other filters. Do you have any there?

              • 4. Re: 'Richfaces' is undefined
                Elias Neri Newbie

                I'm having the same problem.
                Relevant web.xml extracts:

                <context-param>
                 <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                 <param-value>
                 com.sun.facelets.FaceletViewHandler,org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl
                 </param-value>
                </context-param>
                

                <!-- Acegi security filter -->
                <filter>
                 <filter-name>securityFilter</filter-name>
                 <filter-class>
                 org.acegisecurity.util.FilterToBeanProxy
                 </filter-class>
                 <init-param>
                 <param-name>targetClass</param-name>
                 <param-value>
                 org.acegisecurity.util.FilterChainProxy
                 </param-value>
                 </init-param>
                </filter>
                <!-- ajax4jsf filter -->
                <filter>
                 <display-name>Ajax4jsf Filter</display-name>
                 <filter-name>ajax4jsf</filter-name>
                 <filter-class>org.ajax4jsf.Filter</filter-class>
                </filter>
                <!-- trinidad filter -->
                <filter>
                 <filter-name>adfFaces</filter-name>
                 <filter-class>
                 org.apache.myfaces.trinidad.webapp.TrinidadFilter
                 </filter-class>
                </filter>
                <!-- shale filter -->
                <filter>
                 <filter-name>shale</filter-name>
                 <filter-class>
                 org.apache.shale.application.faces.ShaleApplicationFilter
                 </filter-class>
                </filter>
                

                <filter-mapping>
                 <filter-name>securityFilter</filter-name>
                 <url-pattern>/*</url-pattern>
                </filter-mapping>
                <filter-mapping>
                 <filter-name>ajax4jsf</filter-name>
                 <servlet-name>facesServlet</servlet-name>
                 <dispatcher>FORWARD</dispatcher>
                 <dispatcher>REQUEST</dispatcher>
                 <dispatcher>INCLUDE</dispatcher>
                </filter-mapping>
                <filter-mapping>
                 <filter-name>adfFaces</filter-name>
                 <servlet-name>facesServlet</servlet-name>
                </filter-mapping>
                <filter-mapping>
                 <filter-name>shale</filter-name>
                 <url-pattern>/*</url-pattern>
                </filter-mapping>
                


                • 5. Re: 'Richfaces' is undefined
                  Sergey Smirnov Master

                  eneri, the Ajax4jsf filter should come first

                  • 6. Re: 'Richfaces' is undefined
                    Elias Neri Newbie

                    Thanks for your answer, but changing the order does not solve the issue.

                    What I did discover though is that at the moment I add the shale jars (shale-view, shale-tiger, shale-application, shale-core) to your demo application's classpath "richfaces-demo-3.0.1-20070315.135447-1", that demo fails with the same javascript errors.
                    When I remove shale, the demo works.