You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by José de Jesus Vargas Ibañez <jv...@rmmi.com> on 2005/07/08 20:03:46 UTC

inputCalendar problem (required field)

Hi:

I'm new to all this JSF and myFaces stuff. Currently I'm developing a 
system using the myFaces framework. I saw that there is a calendar, i've 
test it for a prototype and it worked fine. Now that I'm developing the 
real application I got a problem. The field is required so I've marked 
it as required=true

<x:inputCalendar id="openingDate" required="true" renderAsPopup="true" 
value="#{auction.openingDate}" popupDateFormat="MM/dd/yyyy" />

When I press the commandButton it delivers this exception:

org.apache.jasper.JasperException: Expected submitted value of type Date for component : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /sse/CreateAuction.jsp][Class: javax.faces.component.html.HtmlForm,Id: _id2][Class: org.apache.myfaces.custom.calendar.HtmlInputCalendar,Id: openingDate]}
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
	com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
	com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
	com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
	com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)

*root cause*

java.lang.IllegalArgumentException: Expected submitted value of type Date for component : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /sse/CreateAuction.jsp][Class: javax.faces.component.html.HtmlForm,Id: _id2][Class: org.apache.myfaces.custom.calendar.HtmlInputCalendar,Id: openingDate]}
	org.apache.myfaces.renderkit.RendererUtils.getDateValue(RendererUtils.java:245)
	org.apache.myfaces.custom.calendar.HtmlCalendarRenderer.encodeEnd(HtmlCalendarRenderer.java:131)
	javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:720)
	javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:623)
	javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:546)
	org.apache.jsp.sse.CreateAuction_jsp._jspx_meth_x_inputCalendar_0(CreateAuction_jsp.java:619)
	org.apache.jsp.sse.CreateAuction_jsp._jspx_meth_h_form_1(CreateAuction_jsp.java:341)
	org.apache.jsp.sse.CreateAuction_jsp._jspx_meth_f_view_0(CreateAuction_jsp.java:160)
	org.apache.jsp.sse.CreateAuction_jsp._jspService(CreateAuction_jsp.java:112)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
	com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
	com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
	com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
	com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)

I hope you can help me. Thnks

-- 
Ing. José de Jesús Vargas Ibáñez
aklara

Conm. (52 55) 5000-4200
Dir.  (52 55) 5000-4204
Fax.  (52 55) 5000-4242
jvargas@aklara.com
http://www.aklara.com