[
https://issues.jboss.org/browse/RF-12032?page=com.atlassian.jira.plugin.s...
]
Jean ANDRE edited comment on RF-12032 at 3/29/12 4:53 PM:
----------------------------------------------------------
1) Yes of course
2) I do not remember - it is an idea - however, there was a h:messages on the calendar as
we got some message (see screen shot) but no message for the conversion error. With the
workbench, we can easily test the case as I have added a calendar in one screen by default
- We just need to modify the backing bean (controller) for sql.Date type and see what is
appening.
sql.Date and util.Date are both native standard format to java. Why do not support them as
standard. Moreover, most of the time, we received the data from the database/ORM and the
date is SQL date.
What about having something like "auto-boxing" or automatic conversion when it
is feasible for native format?
We are not alone for this need and around.
-
https://community.jboss.org/thread/10589
-
http://stackoverflow.com/questions/7982528/rich-calendar-date-formatting
-
http://stackoverflow.com/questions/7397096/how-to-check-null-value-for-da...
-
http://www.developpez.net/forums/d739236/java/developpement-web-java/fram...
-
http://www.developpez.net/forums/d967420/java/developpement-web-java/fram...
was (Author: jorelia64):
1) Yes of course
2) I do not remember - it is an idea - however, there was a h:messages on the calendar as
we got some message (see screen shot) but no message for the conversion error. With the
workbench, we can easily test the case as I have added a calendar in one screen by default
- We just need to modify the backing bean (controller) for sql.Date type and see what is
appening.
sql.Date and util.Date are both native standard format to java. Why do not support them as
standard. Moreover, most of the time, we received the data from the database/ORM and the
date is SQL date.
What about having something like "auto-boxing" or automatic conversion when it
is feasible for native format?
We are not alone for this needs and around.
-
https://community.jboss.org/thread/10589
-
http://stackoverflow.com/questions/7982528/rich-calendar-date-formatting
-
http://stackoverflow.com/questions/7397096/how-to-check-null-value-for-da...
-
http://www.developpez.net/forums/d739236/java/developpement-web-java/fram...
-
http://www.developpez.net/forums/d967420/java/developpement-web-java/fram...
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