Author: abelevich
Date: 2008-07-17 11:26:44 -0400 (Thu, 17 Jul 2008)
New Revision: 9664
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-3858
Modified: trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2008-07-17
15:22:39 UTC (rev 9663)
+++ trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2008-07-17
15:26:44 UTC (rev 9664)
@@ -353,18 +353,6 @@
}
- protected void validateValue(FacesContext context, Object newValue) {
- // TODO nick - nick - do we need this?
- // store converted value in submitted value to ease client-side code's
- // life
- // see
- // org.richfaces.renderkit.CalendarRendererBase.getSelectedDate(FacesContext,
- // UICalendar) for more
- setSubmittedValue(newValue);
-
- super.validateValue(context, newValue);
- }
-
public void updateCurrentDate(FacesContext context, Object currentDate) {
if (context == null) {
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-07-17
15:22:39 UTC (rev 9663)
+++
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-07-17
15:26:44 UTC (rev 9664)
@@ -488,22 +488,29 @@
UICalendar calendar = (UICalendar) component;
// XXX nick - nick - can contain either Date or String instance
// Fix for myFaces 1.1.x RF-997
+
+ String returnValue = null;
Date value = null;
- try {
- value = calendar.getAsDate(calendar.getSubmittedValue());
- } catch (Exception e) {
+ String submittedValue = (String)calendar.getSubmittedValue();
+
+ if (submittedValue != null) {
+ try {
+ value = calendar.getAsDate(submittedValue);
+ } catch (Exception e) {
if (log.isDebugEnabled()) {
- log.debug(" InputValue: " + e.toString(), e);
+ log.debug(" InputValue: " + e.toString(), e);
}
- value = null;
- }
- Date curVal = calendar.getAsDate(calendar.getValue());
+ returnValue = (String)calendar.getSubmittedValue();
+ }
+ } else {
+ value = calendar.getAsDate(calendar.getValue());
+ }
- if (value == null) {
- value = curVal;
- }
+ if (value != null) {
+ returnValue = getFormattedValue(context, calendar, value);
+ }
- return getFormattedValue(context, calendar, value);
+ return returnValue;
}
public void writeSymbols(FacesContext facesContext, UICalendar calendar)