| 1 |
define([ |
| 2 |
"dojo/_base/lang", |
| 3 |
"dojo/_base/kernel", |
| 4 |
"dojo/_base/declare" |
| 5 |
], function(lang, dojo, declare){ |
| 6 |
return declare("dojox.form.manager._ValueMixin", null, { |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
elementValue: function(name, value){ |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
if(name in this.formWidgets){ |
| 23 |
return this.formWidgetValue(name, value); |
| 24 |
} |
| 25 |
|
| 26 |
if(this.formNodes && name in this.formNodes){ |
| 27 |
return this.formNodeValue(name, value); |
| 28 |
} |
| 29 |
|
| 30 |
return this.formPointValue(name, value); |
| 31 |
}, |
| 32 |
|
| 33 |
gatherFormValues: function(names){ |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
var result = this.inspectFormWidgets(function(name){ |
| 42 |
return this.formWidgetValue(name); |
| 43 |
}, names); |
| 44 |
|
| 45 |
if(this.inspectFormNodes){ |
| 46 |
lang.mixin(result, this.inspectFormNodes(function(name){ |
| 47 |
return this.formNodeValue(name); |
| 48 |
}, names)); |
| 49 |
} |
| 50 |
|
| 51 |
lang.mixin(result, this.inspectAttachedPoints(function(name){ |
| 52 |
return this.formPointValue(name); |
| 53 |
}, names)); |
| 54 |
|
| 55 |
return result; |
| 56 |
}, |
| 57 |
|
| 58 |
setFormValues: function(values){ |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
if(values){ |
| 64 |
this.inspectFormWidgets(function(name, widget, value){ |
| 65 |
this.formWidgetValue(name, value); |
| 66 |
}, values); |
| 67 |
|
| 68 |
if(this.inspectFormNodes){ |
| 69 |
this.inspectFormNodes(function(name, node, value){ |
| 70 |
this.formNodeValue(name, value); |
| 71 |
}, values); |
| 72 |
} |
| 73 |
|
| 74 |
this.inspectAttachedPoints(function(name, node, value){ |
| 75 |
this.formPointValue(name, value); |
| 76 |
}, values); |
| 77 |
} |
| 78 |
return this; |
| 79 |
} |
| 80 |
}); |
| 81 |
}); |