Methods:
• displayMessage(String) – displays the message associated with the text box. If no parameter is
supplied, any existing message that is currently being shown is removed.
<input dojoType="dijit.form.ValidationTextBox"
id="userName"
value=""
invalidMessage="Proper value is required"
promptMessage="Enter user name"
lowercase="true"
required="true"
regExp="[a-z]*"
maxLength="5"
trim="true" />
Text Editors
A common desire in a web UI is to be able to enter text data. This may be a simple single line
entry such as a password or a name or it may be a more advanced entry that can span multiple lines
and include rich text editing.
dijit/form/Textarea
The dijit/form/Textarea widget provides a text box into which multiple lines of data may
be entered. It doesn't explicit state its height. Instead it can expand vertically to include as many
rows as needed. It is common to set its "width style" to be the width that we would want it to be.
When declaring it in HTML, use the <textarea> HTML elements as its container as this will
preserve newline characters on input.
See also:
• dijit/form/SimpleTextarea
• dijit/form/TextBox
dijit/form/TextBox
The TextBox widget provides a single line text input area. The widget can be found in
dijit.form.TextBox. The value of the text box can be found through the value attribute:
box.get("value") to get and box.set("value", "newvalue") to set.
Some of the more interesting properties of TextBox include:
• readOnly – A boolean. If set to true, the text box is read only and does not respond to
user input. However, it does not look "greyed".
• disabled – A boolean. If set to true, the text box is read only and also has a visual
appearance of not allowing user input.
See also:
• dijit/form/Textarea
• dijit/form/SimpleTextarea
dijit/form/SimpleTextarea
This widget provides a fixed size text area (unlike Textarea which resizes).
Page 155
Comentários a estes Manuais