See the dijit/form/_TextBoxMixin reference documentation for more information.
For subclasses like ComboBox where the displayed value (ex: Kentucky) and the serialized value (ex: KY) are different, this represents the displayed value.
Setting 'displayedValue' through set('displayedValue', ...) updates 'value', and vice-versa. Otherwise 'value' is updated from 'displayedValue' periodically, like onBlur etc.
TODO: move declaration to MappedTextBox? Problem is that ComboBox references displayedValue, for benefit of FilteringSelect.
Converts all characters to lowercase if true. Default is false.
Defines a hint to help users fill out the input field (as defined in HTML 5). This should only contain plain text (no html markup).
Converts the first character of each word to uppercase if true.
If true, all text will be selected when focused with mouse
Removes leading and trailing whitespace if true. Default is false.
Converts all characters to uppercase if true. Default is false.
Hook so get('displayedValue') works.
Returns the displayed value (what the user sees on the screen), after filtering (ie, trimming spaces etc.).
For some subclasses of TextBox (like ComboBox), the displayed value is different from the serialized value that's actually sent to the server (see dijit/form/ValidationTextBox.serialize())
Hook so get('value') works as we like.
For dijit/form/TextBox this basically returns the value of the <input>
.
For dijit/form/MappedTextBox subclasses, which have both a "displayed value" and a separate "submit value", This treats the "displayed value" as the master value, computing the submit value from it via this.parse().
Default action handler for user input events
Parameter | Type | Description |
---|---|---|
evt | Event |
After the user types some characters, etc., this method is
called to check the field for validity etc. The base method
in dijit/form/TextBox
does nothing, but subclasses override.
Parameter | Type | Description |
---|---|---|
element | DomNode | |
start | Number |
Optional
|
stop | Number |
Optional
|
Auto-corrections (such as trimming) that are applied to textbox value on blur or form submit.
For MappedTextBox subclasses, this is called twice
and get('value'), ex: a Number for NumberTextBox.
In the latter case it does corrections like converting null to NaN. In the former case the NumberTextBox.filter() method calls this.inherited() to execute standard trimming code in TextBox.filter().
TODO: break this into two methods in 2.0
Parameter | Type | Description |
---|---|---|
val | undefined |
Replaceable function to convert a value to a properly formatted string.
Parameter | Type | Description |
---|---|---|
value | String | |
constraints | Object |
Replaceable function to convert a formatted string to a value
Parameter | Type | Description |
---|---|---|
value | String | |
constraints | Object |
Select text in the input element argument, from start (default 0), to stop (default end).
Parameter | Type | Description |
---|---|---|
element | DomNode | |
start | Number |
Optional
|
stop | Number |
Optional
|
Connect to this function to receive notifications of various user data-input events. Return false to cancel the event and prevent it from being processed.
Parameter | Type | Description |
---|---|---|
event | undefined | keydown | keypress | cut | paste | input |