Procházet zdrojové kódy

修复下拉框、单选框、多选框setData事件不运行的bug

huqi před 5 roky
rodič
revize
e07498456d

+ 6 - 5
o2web/source/x_component_process_Xform/Checkbox.js

@@ -155,18 +155,19 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox =  new Class({
         }.bind(this));
 	},
 
-    _setValue: function(value){
+    _setValue: function(value, m){
+        var mothed = m || "__setValue";
 	    if (!!value){
             var p = o2.promiseAll(value).then(function(v){
                 //if (o2.typeOf(v)=="array") v = v[0];
                 if (this.moduleSelectAG){
                     this.moduleValueAG = this.moduleSelectAG;
                     this.moduleSelectAG.then(function(){
-                        this.__setValue(v);
+                        this[mothed](v);
                         return v;
                     }.bind(this));
                 }else{
-                    this.__setValue(v)
+                    this[mothed](v)
                 }
                 return v;
             }.bind(this));
@@ -175,7 +176,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox =  new Class({
                 this.moduleValueAG = null;
             }.bind(this));
         }else{
-            this.__setValue(value);
+            this[mothed](value);
         }
 
 
@@ -265,7 +266,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox =  new Class({
     },
 
     setData: function(data){
-	    return this._setValue(data);
+	    return this._setValue(data, "__setData");
         // if (data && data.isAG){
         //     this.moduleValueAG = data;
         //     data.addResolve(function(v){

+ 6 - 5
o2web/source/x_component_process_Xform/Radio.js

@@ -214,18 +214,19 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio =  new Class({
         // }.bind(this));
 	},
 
-    _setValue: function(value){
+    _setValue: function(value, m){
+        var mothed = m || "__setValue";
 	    if (!!value){
             var p = o2.promiseAll(value).then(function(v){
                 if (o2.typeOf(v)=="array") v = v[0];
                 if (this.moduleSelectAG){
                     this.moduleValueAG = this.moduleSelectAG;
                     this.moduleSelectAG.then(function(){
-                        this.__setValue(v);
+                        this[mothed](v);
                         return v;
                     }.bind(this));
                 }else{
-                    this.__setValue(v)
+                    this[mothed](v)
                 }
                 return v;
             }.bind(this));
@@ -235,7 +236,7 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio =  new Class({
                 this.moduleValueAG = null;
             }.bind(this));
         }else{
-            this.__setValue(value);
+            this[mothed](value);
         }
 
 
@@ -316,7 +317,7 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio =  new Class({
     },
 
     setData: function(data){
-        return this._setValue(data);
+        return this._setValue(data, "__setData");
         // if (data && data.isAG){
         //     this.moduleValueAG = o2.AG.all(data).then(function(v){
         //         if (o2.typeOf(v)=="array") v = v[0];

+ 6 - 5
o2web/source/x_component_process_Xform/Select.js

@@ -202,18 +202,19 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect =  new Class({
 		this.fireEvent("addOption", [text, value])
 	},
 
-	_setValue: function(value){
+	_setValue: function(value, m){
+		var mothed = m || "__setValue";
 		if (!!value){
 			var p = o2.promiseAll(value).then(function(v){
 				if (o2.typeOf(v)=="array") v = v[0];
 				if (this.moduleSelectAG){
 					this.moduleValueAG = this.moduleSelectAG;
 					this.moduleSelectAG.then(function(){
-						this.__setValue(v);
+						this[mothed](v);
 						return v;
 					}.bind(this));
 				}else{
-					this.__setValue(v)
+					this[mothed](v)
 				}
 				return v;
 			}.bind(this));
@@ -223,7 +224,7 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect =  new Class({
 				this.moduleValueAG = null;
 			}.bind(this));
 		}else{
-			this.__setValue(value);
+			this[mothed](value);
 		}
 
 
@@ -342,7 +343,7 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect =  new Class({
 	},
 
 	setData: function(data){
-		return this._setValue(data);
+		return this._setValue(data, "__setData");
 		// if (data && data.isAG){
 		// 	this.moduleValueAG = o2.AG.all(data).then(function(v){
 		// 		if (o2.typeOf(v)=="array") v = v[0];