dijit/form/_TextBoxMixin (version 1.10)

See the dijit/form/_TextBoxMixin reference documentation for more information.

Property Summary

  • __skipInputEvent
  • _blankValue
  • displayedValueFor subclasses like ComboBox where the displayed value (ex: Kentucky) and the serialized value (ex: KY) are different, this represents the displayed value.
  • lowercaseConverts all characters to lowercase if true.
  • maxLengthHTML INPUT tag maxLength declaration.
  • placeHolderDefines a hint to help users fill out the input field (as defined in HTML 5).
  • propercaseConverts the first character of each word to uppercase if true.
  • selectOnClickIf true, all text will be selected when focused with mouse
  • trimRemoves leading and trailing whitespace if true.
  • uppercaseConverts all characters to uppercase if true.

Method Summary

Event Summary

Properties

__skipInputEvent
_blankValue
displayedValue

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.

lowercase

Converts all characters to lowercase if true. Default is false.

maxLength

HTML INPUT tag maxLength declaration.

placeHolder

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).

propercase

Converts the first character of each word to uppercase if true.

selectOnClick

If true, all text will be selected when focused with mouse

trim

Removes leading and trailing whitespace if true. Default is false.

uppercase

Converts all characters to uppercase if true. Default is false.

Methods

_getDisplayedValueAttr()

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())

Returns:undefined
_getValueAttr()

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().

Returns:undefined
_isTextSelected()
Returns:boolean
_processInput(evt)

Default action handler for user input events

Parameter Type Description
evt Event
_refreshState()

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.

_setBlurValue()
_setDisplayedValueAttr()
_setSelectionRange(element,start,stop)
Defined by dijit/form/TextBox
Parameter Type Description
element DomNode
start Number
Optional
stop Number
Optional
_setValueAttr()
filter(val)

Auto-corrections (such as trimming) that are applied to textbox value on blur or form submit.

For MappedTextBox subclasses, this is called twice

  • once with the display value
  • once the value as set/returned by set('value', ...)

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
Returns:undefined
format(value,constraints)

Replaceable function to convert a value to a properly formatted string.

Parameter Type Description
value String
constraints Object
Returns:string
parse(value,constraints)

Replaceable function to convert a formatted string to a value

Parameter Type Description
value String
constraints Object
Returns:String
postCreate()
reset()
selectInputText(element,start,stop)

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

Events

_onBlur(e)
Parameter Type Description
e undefined
_onFocus(by)
Parameter Type Description
by String
_onInput()
onInput(event)

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

Error in the documentation? Can’t find what you are looking for? Let us know!