Problem with RichFaces Calendar control
bond007 Sep 7, 2009 2:28 PMHi,
I am using Seam 2.0.1GA , RichFaces 3.2.0GA, JSF 1.2 and Facelets 1.1.14 on Wepsphere 6.1.
I am trying to get the richfaces calendar control on one of my JSF pages.
Unfortunately i am not able to get there. I do see it on UI, but while loading the page, it throws a JS error : 'Calendar' is undefined.
Also in the backend ( in server logs) it throws this exception:
org.ajax4jsf.resource.ResourceNotFoundException: Resource not registered : /org/richfaces/ui.pack.js.seam
and
org.ajax4jsf.resource.ResourceNotFoundException: Resource not registered : /org/ajax4jsf/framework.pack.js.seam
I have gone through the user guide and added relevant entries.
This is what i have in my web.xml
<!-- Ajax4jsf --> <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>NONE,NEKO,TIDY</param-value> </context-param> <context-param> <param-name>org.ajax4jsf.xmlparser.NONE</param-name> <param-value>/pages/performance\.xhtml,/pages/default.*\.xhtml</param-value> </context-param> <context-param> <param-name>org.ajax4jsf.xmlparser.NEKO</param-name> <param-value>/pages/repeat\.xhtml</param-value> </context-param> <context-param> <param-name>org.richfaces.LoadScriptStrategy</param-name> <param-value>ALL</param-value> </context-param> <context-param> <param-name>org.richfaces.LoadStyleStrategy</param-name> <param-value>ALL</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>FORWARD</dispatcher> <dispatcher>REQUEST</dispatcher> <dispatcher>INCLUDE</dispatcher> </filter-mapping> <!-- Facelets development mode (disable in production) --> <context-param> <param-name>facelets.DEVELOPMENT</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>facelets.REFRESH_PERIOD</param-name> <param-value>2</param-value> </context-param> <context-param> <param-name>facelets.LIBRARIES</param-name> <param-value/WEB-INF/facelets/tags/elfunctions.taglib.xml</param-value> </context-param> <!-- JSF --> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.xhtml</param-value> </context-param> <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> <!-- 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.SeamResourceServlet</servlet-class> </servlet> <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>Seam Resource Servlet</servlet-name> <url-pattern>/seam/resource/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.seam</url-pattern> </servlet-mapping> <security-constraint> <display-name>Restrict raw XHTML Documents</display-name> <web-resource-collection> <web-resource-name>XHTML</web-resource-name> <url-pattern>*.xhtml</url-pattern> </web-resource-collection> <auth-constraint /> </security-constraint>
This is how I use the calendar control in the JSF page:
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <style type="text/css"> .ecol1 { vertical-align: top; padding-right : 25px } .ecol2 { vertical-align: top; border-left: #ACBECE 1px solid; padding-left : 10px } .rich-calendar-tool-btn{ font-family: Arial, Verdana; } </style> <h:form> <h:panelGrid id="panel" columns="2" columnClasses="ecol1, ecol2"> <a4j:outputPanel id="calendar" layout="block"> <rich:calendar value="#{testAction.effectiveDate}" locale="en/US" popup="true" datePattern="MMM d, yyyy" showApplyButton="true" cellWidth="24px" cellHeight="22px" style="width:200px"/> </a4j:outputPanel> <h:panelGrid> Test </h:panelGrid> </h:panelGrid> </h:form> </ui:composition>
Can anyone please help me to overcome this error?
Thanks in advance,
- Kiran