提交 2ec93e94 编写于 作者: NoSubject's avatar NoSubject

Merge branch 'feature/new-JSONData' into 'wrdp'

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

See merge request o2oa/o2oa!2264
......@@ -159,18 +159,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));
......@@ -179,7 +180,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class({
this.moduleValueAG = null;
}.bind(this));
}else{
this.__setValue(value);
this[mothed](value);
}
......@@ -269,7 +270,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){
......
......@@ -218,18 +218,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));
......@@ -239,7 +240,7 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class({
this.moduleValueAG = null;
}.bind(this));
}else{
this.__setValue(value);
this[mothed](value);
}
......@@ -320,7 +321,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];
......
......@@ -206,18 +206,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));
......@@ -227,7 +228,7 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect = new Class({
this.moduleValueAG = null;
}.bind(this));
}else{
this.__setValue(value);
this[mothed](value);
}
......@@ -346,7 +347,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];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册