Date Input error

Hi,

I am using a date field(FROM_RECEIVED_DATE) in my UI and I am providing input in MM/dd/yyyy format.
When I click on search button, its throwing the below mentioned error in MWS:

[POP.001.0002] A “javax.portlet.PortletException” occurred with the Message “[POP.016.0011] DateInput component value must be a java.util.Date instance”
javax.faces.FacesException: [POP.016.0011] DateInput component value must be a java.util.Date instance at com.webmethods.caf.faces.component.input.DateInput.getDate(DateInput.java:112) at com.webmethods.caf.faces.render.html.input.DateInputRenderer.formatDate(DateInputRenderer.java:531) at com.webmethods.caf.faces.render.html.input.DateInputRenderer.writeDate(DateInputRenderer.java:143) at com.webmethods.caf.faces.render.html.input.DateInputRenderer.writeContent(DateInputRenderer.java:100) at com.webmethods.caf.faces.render.html.input.DateInputRenderer.encodeEnd(DateInputRenderer.java:80) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at com.webmethods.caf.faces.component.util.ComponentUtils.renderComponent(ComponentUtils.java:96) at com.webmethods.caf.faces.component.util.ComponentUtils.renderComponent(ComponentUtils.java:93) at com.webmethods.caf.faces.component.util.ComponentUtils.renderComponent(ComponentUtils.java:93) at com.webmethods.caf.faces.component.util.ComponentUtils.renderComponent(ComponentUtils.java:93) at com.webmethods.caf.faces.component.util.ComponentUtils.renderComponent(ComponentUtils.java:93) at com.webmethods.caf.faces.view.BaseViewHandler.renderResponse(BaseViewHandler.java:268) at com.webmethods.caf.faces.view.BaseViewHandler.renderView(BaseViewHandler.java:126) at com.webmethods.caf.faces.portlet.PortletLifecycle$RenderResponsePhase.execute(PortletLifecycle.java:700) at com.webmethods.caf.faces.portlet.PortletLifecycle.phase(PortletLifecycle.java:256) at com.webmethods.caf.faces.portlet.PortletLifecycle.render(PortletLifecycle.java:185) at com.webmethods.caf.faces.portlet.FacesPortlet.render(FacesPortlet.java:337) at com.webmethods.portal.framework.portletcontainer.impl.PortletApplicationHandler.process(PortletApplicationHandler.java:495) at com.webmethods.portal.framework.portletcontainer.servlet.PortletServlet.service(PortletServlet.java:58) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:192) at com.webmethods.portal.framework.portletcontainer.PortletContainer.dispatch(PortletContainer.java:221) at com.webmethods.portal.framework.portletcontainer.PortletContainer.process(PortletContainer.java:130) at com.webmethods.portal.framework.portletcontainer.PortletContainer.renderPortlet(PortletContainer.java:103) at com.webmethods.portal.framework.portletcontainer.beans.PortletBean.processRequest(PortletBean.java:193) at com.webmethods.portal.framework.portletcontainer.beans.PortletBean.getContentInternal(PortletBean.java:82) at com.webmethods.portal.framework.portlet.beans.BasicPortletBean.getContent(BasicPortletBean.java:143) at com.webmethods.portal.mech.portlet.impl.PortletMechanics.getPortletContent(PortletMechanics.java:97) at com.webmethods.portal.mech.storage.page.PortletHelper.renderContent(PortletHelper.java:428) at com.webmethods.portal.mech.storage.page.PortletHelper.renderContent(PortletHelper.java:400) at com.webmethods.portal.framework.presentation.renderers.TabulaRasaPortletRenderer.renderPageContent(TabulaRasaPortletRenderer.java:46) at com.webmethods.portal.framework.presentation.renderers.DefaultRenderer.render(DefaultRenderer.java:224) at com.webmethods.portal.framework.presentation.PresentationManager.handlePres(PresentationManager.java:372) at com.webmethods.portal.framework.dispatch.DispatchManager.pres(DispatchManager.java:622) at com.webmethods.portal.framework.dispatch.DispatchManager.handle(DispatchManager.java:462) at com.webmethods.portal.framework.dispatch.DispatchManager.handleDispatch(DispatchManager.java:372) at com.webmethods.portal.framework.impl.PortalServlet.service(PortalServlet.java:280) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) at com.webmethods.portal.framework.impl.NTLMFilter.doFilter(NTLMFilter.java:50) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.webmethods.caf.faces.servlet.GZIPFilter.doFilter(GZIPFilter.java:42) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.webmethods.portal.framework.impl.RequestFilter.doFilter(RequestFilter.java:56) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)Hide Details ? Close

Can someone please help me on how to resolve this issue.

Regards
Jyoti

Hi Jyoti,

Seems like your are trying to assign date type filed with string filed.
Can you please check if in date input you are assigning some string value or if in after action command call you are assigning some date field with some sting value.

Thanks
Baharul Islam

Jyoti, when you map these date value to a string object without providing the pattern, it is bound to fail.

Try to provide some pattern like ‘yyyyMMdd’ which should works.

Thanks,

Hi Baharul/MR as173d

Yes, I am using a string(FROM_RECEIVED_DATE).
What I came to know from the CAF developer guide is that we have to use java.text.SimpleDateFormat if we are binding the input to a string value.
But I am not sure how to do that.
Could you please assist.

Regards
jyoti

Hi Jyoti,
In manage bean you can take one date object variable.

Or can you please explain your scenerio like what operation your are likey to perform after taking date as input wheather you are calling some webService or from webService output you are assining to date filed.

Thanks
Baharul Islam

yes Baharul.

We are passing input in the UI and calling the backend service with those inputs and fetching the data from the database and showing that in Search Results page.
We are making a webservice call.

Regards
Jyoti

Jyoti,can you please try in this way…
Right click on manage bin and add a variable of type(java.util.date).Then bind your UI input with this date field and also bind date filed with webService input field.

Please let me know if you still face any problem,I will try to develop the same.

Thanks
Baharul Islam

Hi Jyoti,

Are you resetting in any way the field?

If yes, please make sure that the code is:
myField.setValue(null);
and not
myField.setValue("");

Hope it helps,
Vlad Turian