[richfaces-issues] [JBoss JIRA] (RF-12032) rich:calendar : Ajax request - Error message enhancement - sql.Date

Jean ANDRE (JIRA) jira-events at lists.jboss.org
Wed Mar 21 16:12:47 EDT 2012


    [ https://issues.jboss.org/browse/RF-12032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678450#comment-12678450 ] 

Jean ANDRE commented on RF-12032:
---------------------------------

I have not checked the server log, in production we do not have access right away to the log files, it is why, it will be more suitable to have:

1) An standard error of conversion displayed at the user screen - The screen shot does not show the problem because in fact, we have no message. More over, the message does not talk about conversion error but about a mandatory value from an another validator @NotNull
2) Or to support both date format according to the date format given by the backing
3) Any message at the user screen instead of having a silent error.
                
> 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
>              Labels: waiting_on_user
>         Attachments: rich_calendar_errorMsg_Enhancement.png
>
>
> 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?
> Other information
> =================
> The form is inside a dynamic tab - Fragment are also include dynamically - we use c:if et subView as shown below:
> {code}
> <c:if test="#{tab.id eq desktopTabController.activeTab}">
>   <f:subview id="#{tab.id}-subView">
>     <ui:include src="#{tab.xhtmlFile}" />
>   </f:subview>
> </c:if>
> {code}

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

        


More information about the richfaces-issues mailing list