]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dijit/form/SimpleTextarea.js
Comment class stub
[eow] / static / dojo-release-1.1.1 / dijit / form / SimpleTextarea.js
1 if(!dojo._hasResource["dijit.form.SimpleTextarea"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2 dojo._hasResource["dijit.form.SimpleTextarea"] = true;
3 dojo.provide("dijit.form.SimpleTextarea");
4
5 dojo.require("dijit.form._FormWidget");
6
7 dojo.declare("dijit.form.SimpleTextarea",
8         dijit.form._FormValueWidget,
9 {
10         // summary:
11         //              A simple textarea that degrades, and responds to
12         //              minimal LayoutContainer usage, and works with dijit.form.Form.
13         //              Doesn't automatically size according to input, like Textarea.
14         //
15         // example:
16         //      |       <textarea dojoType="dijit.form.SimpleTextarea" name="foo" value="bar" rows=30 cols=40/>
17         //
18
19         baseClass: "dijitTextArea",
20
21         attributeMap: dojo.mixin(dojo.clone(dijit.form._FormValueWidget.prototype.attributeMap),
22                 {rows:"focusNode", cols: "focusNode"}),
23
24         // rows: Number
25         //              The number of rows of text.
26         rows: "",
27
28         // rows: Number
29         //              The number of characters per line.
30         cols: "",
31
32         templateString: "<textarea name='${name}' dojoAttachPoint='focusNode,containerNode'>",
33
34         postMixInProperties: function(){
35                 if(this.srcNodeRef){
36                         this.value = this.srcNodeRef.value;
37                 }
38         },
39
40         setValue: function(/*String*/ val){
41                 this.domNode.value = val;
42                 this.inherited(arguments);
43         },
44
45         getValue: function(){
46                 return this.domNode.value.replace(/\r/g,"");
47         }
48 });
49
50 }