Author: vbaranov
Date: 2008-04-10 06:16:43 -0400 (Thu, 10 Apr 2008)
New Revision: 7730
Modified:
branches/3.1.x/ui/calendar/src/main/config/component/calendar.xml
branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
branches/3.1.x/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2757
Modified: branches/3.1.x/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- branches/3.1.x/ui/calendar/src/main/config/component/calendar.xml 2008-04-10 09:58:14
UTC (rev 7729)
+++ branches/3.1.x/ui/calendar/src/main/config/component/calendar.xml 2008-04-10 10:16:43
UTC (rev 7730)
@@ -335,6 +335,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:
branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
---
branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-10
09:58:14 UTC (rev 7729)
+++
branches/3.1.x/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-04-10
10:16:43 UTC (rev 7730)
@@ -1739,25 +1739,31 @@
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: branches/3.1.x/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
---
branches/3.1.x/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2008-04-10
09:58:14 UTC (rev 7729)
+++
branches/3.1.x/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2008-04-10
10:16:43 UTC (rev 7730)
@@ -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) {