9 Replies Latest reply on Feb 24, 2009 2:27 AM by lukep1984

    RichFaces is not defined

    mehdihaloui

      Hi,
      Well its my first time using the richfaces library, but i ve been using some other libraries though..
      i m having a problem with the dropDownMenu component, i used the example from the livedemo but when i launch my application i get the javascript error Richfaces is not defined:

      RichFaces is not defined
      <td class="optionList"><div class="dr-me...tStyle':''} );</script></div></div></td>
      
      RichFaces is not defined
      <td class="optionList"><div class="dr-me...tStyle':''} );</script></div></div></td>


      The code im using for the menu is
      <h:form>
       <h:panelGrid columnClasses="optionList" columns="1" cellspacing="0" cellpadding="0">
       <rich:dropDownMenu style="border:1px solid #{a4jSkin.panelBorderColor}" value="Option1"
       submitMode="none" direction="bottom-right" jointPoint="tr">
       <rich:menuItem value="Suboption1-1" />
       <rich:menuItem value="Suboption1-2"/>
       <rich:menuItem value="Suboption1-3" />
       </rich:dropDownMenu>
       <rich:dropDownMenu style="border:1px solid #{a4jSkin.panelBorderColor}" value="Option2"
       submitMode="none" direction="bottom-right" jointPoint="tr">
       <rich:menuItem value="Suboption2-1" />
       <rich:menuItem value="Suboption2-2" />
       <rich:menuItem value="Suboption2-3" />
       </rich:dropDownMenu>
       <rich:dropDownMenu style="border:1px solid #{a4jSkin.panelBorderColor}" value="Option3"
       submitMode="none" direction="bottom-right" jointPoint="tr">
       <rich:menuItem value="Suboption3-1" />
       <rich:menuItem value="Suboption3-2" />
       <rich:menuItem value="Suboption3-3" />
       </rich:dropDownMenu>
      
       </h:panelGrid>
       </h:form>


      the menu is shown, but there is no action and the submenus dont appear..
      i am using the RichFaces3.3.0.GA release..
      i dont know if you need more details..but in case just let me know..
      thanks in advance





        • 1. Re: RichFaces is not defined
          mehdihaloui

          Well, just want to add one little thing, in the firebug html viewer, when i check the content of the javascript links of richfaces (which are automatically generated..) for example:


          <script type="text/javascript" src="*.jsf/faces/a4j/g3_3_0.GAorg.ajax4jsf.javascript.PrototypeScript">



          the content is an apache tomcat 404 error.. so i guess the main problem is that the route for that source code is not loading from the correct place.. but this is made automatically so i dont really know how can i get it to work..
          hope this helps..
          thanks again


          • 2. Re: RichFaces is not defined
            ilya_shaikovsky

            show your web.xml please.

            • 3. Re: RichFaces is not defined
              ilya_shaikovsky

              show your web.xml please.

              • 4. Re: RichFaces is not defined
                mehdihaloui

                Thanks..
                Here is my web.xml

                <?xml version="1.0" encoding="UTF-8"?>
                <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xmlns="http://java.sun.com/xml/ns/javaee"
                 xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                 id="WebApp_ID" version="2.5">
                 <display-name>Cartas</display-name>
                 <welcome-file-list>
                 <welcome-file>start.jsp</welcome-file>
                 <welcome-file>index.html</welcome-file>
                 <welcome-file>index.htm</welcome-file>
                 <welcome-file>index.jsp</welcome-file>
                 <welcome-file>default.html</welcome-file>
                 <welcome-file>default.htm</welcome-file>
                 <welcome-file>default.jsp</welcome-file>
                 </welcome-file-list>
                 <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>*.jsf</url-pattern>
                 <url-pattern>/faces/*</url-pattern>
                 </servlet-mapping>
                
                 <!-- RICHFACES INTEGRATION -->
                
                 <context-param>
                 <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
                 <param-value>true</param-value>
                 </context-param>
                
                 <context-param>
                 <param-name>
                 org.apache.myfaces.CHECK_EXTENSIONS_FILTER
                 </param-name>
                 <param-value>false</param-value>
                 </context-param>
                 <context-param>
                 <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                 <param-value>server</param-value>
                 </context-param>
                
                 <!-- Plugging the "Blue Sky" skin into the project -->
                 <context-param>
                 <param-name>org.richfaces.SKIN</param-name>
                 <param-value>blueSky</param-value>
                 </context-param>
                
                 <!-- Making the RichFaces skin spread to standard HTML controls -->
                 <context-param>
                 <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                 <param-value>enable</param-value>
                 </context-param>
                
                 <!-- Defining and mapping the RichFaces filter -->
                 <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>
                 <listener>
                 <listener-class>
                 com.sun.faces.config.ConfigureListener
                 </listener-class>
                 </listener>
                
                 <!-- END ||||| RICHFACES INTEGRATION -->
                
                </web-app>


                thanks again

                • 5. Re: RichFaces is not defined
                  ilya_shaikovsky

                  which server you using? could you provide you sample in war?

                  • 6. Re: RichFaces is not defined
                    mehdihaloui

                    I am using Apache Tomcat 6.0.18..
                    about the war, u mean like atach it ?

                    • 7. Re: RichFaces is not defined
                      ilya_shaikovsky

                      email ishaikovsky at exadel dot com

                      • 8. Re: RichFaces is not defined
                        mehdihaloui

                        ok the email is being sended, the war is about 13MB.. so maybe it ll take a little time.. let me know if u need anything..
                        thanks

                        • 9. Re: RichFaces is not defined

                          I have similar problem. Is answer for this problem?!