cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r593364 - /cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/DropdownDateTimePicker.js
Date Thu, 08 Nov 2007 23:52:25 GMT
Author: antonio
Date: Thu Nov  8 15:52:21 2007
New Revision: 593364

URL: http://svn.apache.org/viewvc?rev=593364&view=rev
Log:
Allow customized onchange event.

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/DropdownDateTimePicker.js

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/DropdownDateTimePicker.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/DropdownDateTimePicker.js?rev=593364&r1=593363&r2=593364&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/DropdownDateTimePicker.js
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/DropdownDateTimePicker.js
Thu Nov  8 15:52:21 2007
@@ -27,7 +27,6 @@
  */
 dojo.widget.defineWidget("cocoon.forms.DropdownDateTimePicker", dojo.widget.HtmlWidget,
     function() {
-
     },
 
     {
@@ -49,6 +48,8 @@
 
         containerToggleDuration: 150,
 
+        onchange: "",
+
         postMixInProperties: function(args, frag, parent) {
             cocoon.forms.DropdownDateTimePicker.superclass.postMixInProperties(this, args,
frag, parent);
 
@@ -70,7 +71,11 @@
             this._splitPattern();
             this._initDateFormatOptions();
 
-            this.templateString = "<span style='white-space: nowrap'><input dojoAttachPoint='inputNode'
autocomplete='off' style='vertical-align: middle'/>";
+            this.templateString = "<span style='white-space: nowrap'><input dojoAttachPoint='inputNode'
autocomplete='off' style='vertical-align: middle'";
+            if (this.onchange != "") {
+            	this.templateString += " onchange=" + dojo.string.escapeString(this.onchange);
+            }
+            this.templateString +="/>";
 
             if (this._datePickerNeeded()) {
                 this.templateString += "<img src='${this.dateIconURL}' dojoAttachEvent='onclick:_onDateIconClick'
dojoAttachPoint='dateButtonNode' style='vertical-align: middle; cursor: pointer; cursor: hand'/>";
@@ -88,7 +93,7 @@
             this.templateString += "</span>";
         },
 
-        attachTemplateNodes: function(){
+        attachTemplateNodes: function() {
             // summary: use attachTemplateNodes to specify containerNode, as fillInTemplate
is too late for this
             cocoon.forms.DropdownDateTimePicker.superclass.attachTemplateNodes.apply(this,
arguments);
 
@@ -162,7 +167,7 @@
             if (this.inputNode.disabled)
                 return;
 
-            if(!this.timePopup.isShowingNow) {
+            if (!this.timePopup.isShowingNow) {
                 var currentValue = this._parseCurrentInput();
                 if (currentValue != null)
                     this.timePicker.setTime(currentValue);
@@ -184,9 +189,10 @@
             }
             this.inputNode.value = dojo.date.format(value, this.dateFormatOptions);
 
-            if(this.datePopup.isShowingNow) {
+            if (this.datePopup.isShowingNow) {
                 this.datePopup.close();
             }
+            eval(this.onchange);
         },
 
         _updateTime: function(value) {
@@ -198,6 +204,7 @@
                 }
             }
             this.inputNode.value = dojo.date.format(value, this.dateFormatOptions);
+            eval(this.onchange);
         },
 
         _parseCurrentInput: function() {



Mime
View raw message