Author: abelevich
Date: 2011-01-25 09:41:20 -0500 (Tue, 25 Jan 2011)
New Revision: 21210
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js
Log:
RF-10233 calendar: unexpected validation after month scrolling in ajax mode
-empty componentData was added to ajax response due to correct rendering of calendar.
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2011-01-25
14:34:05 UTC (rev 21209)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2011-01-25
14:41:20 UTC (rev 21210)
@@ -565,10 +565,8 @@
throws IOException {
if (AbstractCalendar.DAYSDATA_META_COMPONENT_ID.equals(metaComponentId)) {
Object preload = ((AbstractCalendar) component).getPreload();
- if (preload != null) {
- Map<String, Object> dataMap =
ExtendedPartialViewContext.getInstance(context).getResponseComponentDataMap();
- dataMap.put(component.getClientId(context), preload);
- }
+ Map<String, Object> dataMap =
ExtendedPartialViewContext.getInstance(context).getResponseComponentDataMap();
+ dataMap.put(component.getClientId(context), preload);
} else {
throw new IllegalArgumentException(metaComponentId);
}
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js
===================================================================
---
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js 2011-01-25
14:34:05 UTC (rev 21209)
+++
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js 2011-01-25
14:41:20 UTC (rev 21210)
@@ -1445,16 +1445,8 @@
callAjax: function(calendar, date) {
var _this = this;
var ajaxSuccess = function (event) {
- if (event.componentData && event.componentData[_this.id])
- {
- var dataDays=event.componentData[_this.id]
- _this.load(dataDays, true);
- } else {
- //
https://issues.jboss.org/browse/RF-10233
- // if calendar DataModel is empty and month is scrolled, so
- // calendar should be rendered
- _this.render();
- }
+ var dataDays=event && event.componentData &&
event.componentData[_this.id];
+ _this.load(dataDays, true);
}
var ajaxError = function (event) {
// do nothing