Author: vbaranov
Date: 2008-04-10 05:58:14 -0400 (Thu, 10 Apr 2008)
New Revision: 7729
Modified:
trunk/ui/calendar/src/main/config/component/calendar.xml
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2450
Modified: trunk/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/ui/calendar/src/main/config/component/calendar.xml 2008-04-10 09:00:00 UTC (rev
7728)
+++ trunk/ui/calendar/src/main/config/component/calendar.xml 2008-04-10 09:58:14 UTC (rev
7729)
@@ -336,6 +336,11 @@
<description>onCurrentDateSelect event handler</description>
</property>
<property>
+ <name>oncurrentdateselected</name>
+ <classname>java.lang.String</classname>
+ <description>onCurrentDateSelected event handler</description>
+ </property>
+ <property>
<name>onexpand</name>
<classname>java.lang.String</classname>
<description>onExpand event handler</description>
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
---
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-10
09:00:00 UTC (rev 7728)
+++
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-10
09:58:14 UTC (rev 7729)
@@ -1752,26 +1752,32 @@
if (this.getCurrentMonth()!=month || this.getCurrentYear()!=year)
{
var date = new Date(year, month,1);
- // fix for RF-2450.
- // Wrong sequence: at first the hidden input with current date value
- // should be updated in function onUpdate()
- // and then the "currentdateselect" Event should be fired.
- this.currentDate = date;
- this.onUpdate();
- this.invokeEvent("currentdateselect", $(this.id), null, date);
+ if (this.invokeEvent("currentdateselect", $(this.id), null, date))
+ {
+ // fix for RF-2450.
+ // Additional event is fired: after the hidden input with current date
+ // value is updated in function onUpdate() and then
+ // the "currentdateselected" Event is fired.
+ this.currentDate = date;
+ this.onUpdate();
+ this.invokeEvent("currentdateselected", $(this.id), null, date);
+ }
}
},
changeCurrentDateOffset: function(yearOffset, monthOffset) {
var date = new Date(this.currentDate.getFullYear()+yearOffset,
this.currentDate.getMonth()+monthOffset,1);
- // fix for RF-2450.
- // Wrong sequence: at first the hidden input with current date value
- // should be updated in function onUpdate()
- // and then the "currentdateselect" Event should be fired.
- this.currentDate = date;
- this.onUpdate();
- this.invokeEvent("currentdateselect", $(this.id), null, date);
+ if (this.invokeEvent("currentdateselect", $(this.id), null, date))
+ {
+ // fix for RF-2450.
+ // Additional event is fired: after the hidden input with current date
+ // value is updated in function onUpdate() and then
+ // the "currentdateselected" Event is fired.
+ this.currentDate = date;
+ this.onUpdate();
+ this.invokeEvent("currentdateselected", $(this.id), null, date);
+ }
},
today: function(noUpdate, noHighlight) {
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2008-04-10
09:00:00 UTC (rev 7728)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2008-04-10
09:58:14 UTC (rev 7729)
@@ -208,6 +208,7 @@
<f:call name="writeEventHandlerFunction"><f:parameter
value="onexpand" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter
value="oncollapse" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter
value="oncurrentdateselect" /></f:call>
+ <f:call name="writeEventHandlerFunction"><f:parameter
value="oncurrentdateselected" /></f:call>
<jsp:scriptlet>/*<![CDATA[*/
if (component.getChildCount() != 0) {