Author: alexsmirnov
Date: 2010-11-22 19:29:47 -0500 (Mon, 22 Nov 2010)
New Revision: 20141
Modified:
branches/RF-8742-1/
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/utils/CalendarHelper.java
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js
Log:
Merged revisions 20135-20136 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r20135 | amarkhel | 2010-11-22 11:18:00 -0800 (Mon, 22 Nov 2010) | 1 line
https://jira.jboss.org/browse/RF-9685 Calendar component: client-side events
.......
r20136 | amarkhel | 2010-11-22 11:20:23 -0800 (Mon, 22 Nov 2010) | 1 line
https://jira.jboss.org/browse/RF-9685 Calendar component: client-side events
.......
Property changes on: branches/RF-8742-1
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-20132
+ /trunk:1-20140
Modified:
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/utils/CalendarHelper.java
===================================================================
---
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/utils/CalendarHelper.java 2010-11-22
23:44:11 UTC (rev 20140)
+++
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/utils/CalendarHelper.java 2010-11-23
00:29:47 UTC (rev 20141)
@@ -33,6 +33,7 @@
import javax.faces.FacesException;
import javax.faces.application.Application;
+import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.DateTimeConverter;
@@ -126,7 +127,9 @@
return result;
}
- public static Locale getAsLocale(FacesContext facesContext, AbstractCalendar
calendar) {
+ public static Locale getAsLocale(FacesContext facesContext, UIComponent component) {
+ AbstractCalendar calendar=(AbstractCalendar) component;
+
if (calendar == null || facesContext == null) {
return null;
}
Modified:
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js
===================================================================
---
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js 2010-11-22
23:44:11 UTC (rev 20140)
+++
branches/RF-8742-1/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js 2010-11-23
00:29:47 UTC (rev 20141)
@@ -267,6 +267,10 @@
var defaultLabels = {apply:'Apply', today:'Today',
clean:'Clean', ok:'OK', cancel:'Cancel', close:'x'};
+ var eventHandlerNames = ["change", "dateselect",
"dateselected", "currentdateselect",
+ "currentdateselected", "currentdateselect", "clean",
"complete", "collapse",
+ "datemouseout", "datemouseover", "expand",
"timeselect", "timeselected"];
+
// Constructor definition
rf.ui.Calendar = function(componentId, locale, options, markups) {
@@ -497,8 +501,13 @@
//alert(new Date().getTime()-_d.getTime());
//define isAjaxMode variable
- "ajax" == this.params.mode ? this.isAjaxMode = true : this.isAjaxMode =
false;
-
+ "ajax" == this.params.mode ? this.isAjaxMode = true : this.isAjaxMode =
false;
+
+ //events handler binding
+ for (var i in eventHandlerNames) {
+ var handler = this.params["on"+eventHandlerNames[i]];
+ if (handler) rf.Event.bindById(this.id, eventHandlerNames[i], handler, this);
+ }
};
// Extend component class and add protected methods from parent class to our container
@@ -963,7 +972,7 @@
if (field.value!=dateStr)
{
field.value=dateStr;
- this.invokeEvent("changed",field, event, this.selectedDate);
+ this.invokeEvent("change",field, event, this.selectedDate);
}
},
@@ -1122,7 +1131,7 @@
}
},
- indexData: function(daysData, isAjaxMode) {
+ indexData:function(daysData, isAjaxMode) {
var dateYear = daysData.startDate.year;
var dateMonth = daysData.startDate.month;
@@ -1668,7 +1677,7 @@
this.invokeEvent("dateselected", null, null, null);
this.selectedDateCellId = this.clearEffect(this.selectedDateCellId,
"rf-ca-sel", (this.params.disabled || this.params.readonly ? null :
"rf-ca-btn"));
-
+ this.invokeEvent("clean", null, null, null);
this.renderHF();
if (!this.params.showApplyButton)
{