2 Replies Latest reply on Apr 30, 2011 10:24 AM by Ghostbrown KT

    JSF 2 + Richfaces 4 "Uncaught ReferenceError: RichFaces is not defined"

    Ghostbrown KT Newbie

      Hi everybody !!!

      I try to configure an application with jsf2+richafaces 4

       

      But when I try to do something i get some errors like

      Uncaught ReferenceError: RichFaces is not defined

      Uncaught TypeError: Cannot call method 'addEventListener' of null

       

       

       

       

      I give you 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">

                <display-name>JSF2 and Spring 3.0 tutorial</display-name>

                 <context-param>

                          <param-name>contextConfigLocation</param-name>

                          <param-value>classpath:application-context*.xml</param-value>

                </context-param>

                  <context-param>

                          <param-name>log4jConfigLocation</param-name>

                          <param-value>classpath:log4j.properties</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.ajax4jsf.VIEW_HANDLERS</param-name>

                          <param-value>com.sun.facelets.FaceletViewHandler</param-value>

                </context-param>

                <filter>

                          <filter-name>springSecurityFilterChain</filter-name>

                          <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>

                </filter>

                <filter-mapping>

                          <filter-name>springSecurityFilterChain</filter-name>

                          <url-pattern>/*</url-pattern>

                          <dispatcher>FORWARD</dispatcher>

                          <dispatcher>REQUEST</dispatcher>

                </filter-mapping>

                  <listener><listener-class>com.sun.faces.config.ConfigureListener</listener-class></listener>

                <listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener>

                <listener><listener-class>org.springframework.web.context.request.RequestContextListener</listener-class></listener>

                  <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>

                </servlet-mapping>

       

                  <welcome-file-list><welcome-file>index.html</welcome-file></welcome-file-list

      </web-app>

       

       

       

       

      my face-config.xml

      <?xml version='1.0' encoding='UTF-8'?>

      <faces-config 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-facesconfig_2_0.xsd"

                version="2.0">

       

                <application>

                          <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>

                </application>

       

      </faces-config>

       

       

      and my web page

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <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">

      <h:form id="locals">

      <f:view>

      <h:commandButton value="Call the popup">

      <rich:componentControl target="popup" operation="show" />

      </h:commandButton>

       

      <rich:popupPanel show="true" id="popup" modal="true" resizeable="true"

      onmaskclick="#{rich:component('locals:popup')}.hide()">

      <f:facet name="header">

      <h:outputText value="Simple popup panel" />

      </f:facet>

      <f:facet name="controls">

      <h:outputLink value="#"

      onclick="#{rich:component('locals:popup')}.hide(); return false;">

      X

      </h:outputLink>

      </f:facet>

      <p>Additionally there you could check how to handle the clicks

      outside the panel.</p>

      <p>In this sample the click outside - closes the panel as well as

      clicking hide control in the header</p>

      </rich:popupPanel>

      </f:view>

      </h:form>

      </html>

       

       

      Please someone can help me !!!

      I use jsf 2.1.1 and richfaces 4.0.0.Final