[JBoss JIRA] (RF-12032) rich:calendar : Ajax request - Error message enhancement - sql.Date
by Jean ANDRE (JIRA)
Jean ANDRE created RF-12032:
-------------------------------
Summary: rich:calendar : Ajax request - Error message enhancement - sql.Date
Key: RF-12032
URL: https://issues.jboss.org/browse/RF-12032
Project: RichFaces
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Environment: cssparser-0.9.6 - guava-11.0.1 - hibernate-validator-4.2.0.Final - JSF/Mojarra 2.1.6 - springframework-3.0.6.RELEASE - richfaces-4.2.0.Final - sac-1.3.jar - Windows 7, WAS 8.0.0.1, Servlet 2.5 - Java 6.
Reporter: Jean ANDRE
When a backing-bean have a type of sql.Date which is mapped to a rich:calendar, there is an conversion error due to the rich:calendar component uses util.Date by default. Unfortunately, we do not see any error message at the screen when an ajax request is sent and returned back to us.
What we got, and thanks to Firebug, is the text below as an answer from our Ajax request POST. Nothing is rendered at the screen and the method of the backing bean is not called.
{code}
<?xml version='1.0' encoding='UTF-8'?>
<partial-response><error><error-name>class javax.faces.component.UpdateModelException</error-name><error-message><![CDATA[/pages/client/createClient.xhtml @479,230 value="#{phoneBean.effectiveDate}": Cannot convert 12-03-08 00:00 of type class java.util.Date to class java.sql.Date]]></error-message></error></partial-response>
{code}
Our code looks like this (we remove unecessary field and decoration):
{code}
<a4j:outputPanel id="phone-container" styleClass="panel-command-container" layout="block">
<!-- -->
<!-- ADD PHONE -->
<!-- -->
<h:commandLink id="add-phone"
value="#{msg['common.command.add.phone']}"
action="#{createClientController.doAddPhone}">
<f:ajax render="phone-container" execute="phone-container" />
</h:commandLink>
<c:forEach items="#{createClientController.phoneBeans}" var="phoneBean" varStatus="status">
<h:panelGrid styleClass="header">
<h:outputLabel value="#{msg['create.client.effective.label']}" styleClass="required" />
<h:panelGroup>
<rich:calendar id="effective-#{status.index}"
value="#{phoneBean.effectiveDate}"
popup="true"
showApplyButton="false"
enableManualInput="true"
datePattern="#{msg['client.date.format']}"
inputSize="12"
styleClass="calendar">
<f:ajax event="inputchange" render="@this" />
</rich:calendar>
<h:message id="effective-msg-#{status.index}" for="effective-#{status.index}" styleClass="rf-msg-err" />
</h:panelGroup>
</h:panelGrid>
</c:forEach>
</a4j:outputPanel>
{code}
Is is possible to have a message returned back to the UI??? or is there a way to handle this error properly?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months