Changeset 12387
- Timestamp:
- 02/11/08 20:17:52 (5 months ago)
- Location:
- dijit/trunk
- Files:
-
- 6 modified
-
form/CheckBox.js (modified) (1 diff)
-
form/Form.js (modified) (3 diffs)
-
form/SimpleTextarea.js (modified) (1 diff)
-
form/Textarea.js (modified) (1 diff)
-
form/_FormWidget.js (modified) (1 diff)
-
tests/form/Form.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/form/CheckBox.js
r11982 r12387 33 33 // equivalent to value field on normal checkbox (if checked, the value is passed as 34 34 // the value when form is submitted) 35 value: "on" 35 value: "on", 36 37 setValue: function(/*String or Boolean*/ newValue){ 38 // summary: set the value of the widget. 39 if(typeof newValue == "string"){ 40 this.setAttribute('value', newValue); 41 newValue = true; 42 } 43 this.setAttribute('checked', newValue); 44 }, 45 46 _getValueDeprecated: false, // remove when _FormWidget:getValue is removed 47 getValue: function(){ 48 // summary: get the value of the widget. 49 return (this.checked ? this.value : false); 50 } 36 51 } 37 52 ); -
dijit/trunk/form/Form.js
r12262 r12387 47 47 // for checkbox/radio, values is a list of which widgets should be checked 48 48 dojo.forEach(widgets, function(w, i){ 49 w.set Attribute('checked', (dojo.indexOf(values, w.value) != -1));49 w.setValue(dojo.indexOf(values, w.value) != -1); 50 50 }); 51 51 }else if(widgets[0].setValues){ … … 152 152 if(/Radio/.test(widget.declaredClass)){ 153 153 // radio button 154 if( widget.checked){154 if(value !== false){ 155 155 dojo.setObject(name, value, obj); 156 156 } … … 162 162 dojo.setObject(name, ary, obj); 163 163 } 164 if( widget.checked){164 if(value !== false){ 165 165 ary.push(value); 166 166 } -
dijit/trunk/form/SimpleTextarea.js
r12384 r12387 35 35 36 36 setValue: function(/*String*/ val){ 37 this.domNode.value = this.value =val;37 this.domNode.value = val; 38 38 this.inherited(arguments); 39 39 }, 40 40 41 41 getValue: function(){ 42 return this.domNode.value ;42 return this.domNode.value.replace(/\r/g,""); 43 43 } 44 44 }); -
dijit/trunk/form/Textarea.js
r12184 r12387 108 108 109 109 getValue: function(){ 110 return this. formValueNode.value.replace(/\r/g,"");110 return this.value.replace(/\r/g,""); 111 111 }, 112 112 -
dijit/trunk/form/_FormWidget.js
r12282 r12387 295 295 setValue: function(/*anything*/ newValue, /*Boolean, optional*/ priorityChange){ 296 296 // summary: set the value of the widget. 297 this.value = newValue; 297 298 this._handleOnChange(newValue, priorityChange); 298 299 }, -
dijit/trunk/tests/form/Form.html
r12261 r12387 58 58 t1: "line 1\nline 2", 59 59 st1: "simple line 1\nsimple line 2", 60 richtext: "<h1>original</h1><p>This is the default content</p>" 60 richtext: "<h1>original</h1><p>This is the default content</p>", 61 filename: "" 61 62 }; 62 63 … … 72 73 t1: "new line 1\nnew line 2", 73 74 st1: "new simple line 1\nnew simple line 2", 74 richtext: "<h1>changed</h1><p>This is the changed content set by setValues</p>" 75 richtext: "<h1>changed</h1><p>This is the changed content set by setValues</p>", 76 filename: "" 75 77 }; 76 78