dijit/form/_FormValueMixin (version 1.10)

dijit/form/_FormWidgetMixin

Summary

Mixin for widgets corresponding to native HTML elements such as <input> or <select> that have user changeable values.

Each _FormValueMixin represents a single input value, and has a (possibly hidden) <input> element, to which it serializes it's input value, so that form submission (either normal submission or via FormBind?) works as expected.

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

Property Summary

  • _onChangeActiveIndicates that changes to the value should call onChange() callback.
  • _setIdAttr
  • _setTabIndexAttr
  • altCorresponds to the native HTML &lt;input&gt; element&#39;s attribute.
  • aria-label
  • disabledShould this widget respond to user input?
  • intermediateChangesFires onChange for each value change or only on demand
  • nameName used when submitting form; same as &quot;name&quot; attribute or plain HTML elements
  • readOnlyShould this widget respond to user input?
  • scrollOnFocusOn focus, should this widget scroll into view?
  • tabIndexOrder fields are traversed when user hits the tab key
  • typeCorresponds to the native HTML &lt;input&gt; element&#39;s attribute.
  • valueCorresponds to the native HTML &lt;input&gt; element&#39;s attribute.

Method Summary

Event Summary

Properties

_onChangeActive

Indicates that changes to the value should call onChange() callback. This is false during widget initialization, to avoid calling onChange() when the initial value is set.

_setIdAttr
_setTabIndexAttr
alt

Corresponds to the native HTML <input> element's attribute.

aria-label
disabled

Should this widget respond to user input? In markup, this is specified as "disabled='disabled'", or just "disabled".

intermediateChanges

Fires onChange for each value change or only on demand

name

Name used when submitting form; same as "name" attribute or plain HTML elements

readOnly

Should this widget respond to user input? In markup, this is specified as "readOnly". Similar to disabled except readOnly form values are submitted.

scrollOnFocus

On focus, should this widget scroll into view?

tabIndex

Order fields are traversed when user hits the tab key

type

Corresponds to the native HTML <input> element's attribute.

value

Corresponds to the native HTML <input> element's attribute.

Methods

_handleOnChange(newValue,priorityChange)

Called when the value of the widget has changed. Saves the new value in this.value, and calls onChange() if appropriate. See _FormWidget._handleOnChange() for details.

Parameter Type Description
newValue anything
priorityChange Boolean
Optional
_setDisabledAttr(value)
Parameter Type Description
value Boolean
_setReadOnlyAttr(value)
Parameter Type Description
value Boolean
_setValueAttr(newValue,priorityChange)

Hook so set('value', value) works.

Sets the value of the widget. If the value has changed, then fire onChange event, unless priorityChange is specified as null (or false?)

Parameter Type Description
newValue anything
priorityChange Boolean
Optional
compare(val1,val2)

Compare 2 values (as returned by get('value') for this widget).

Parameter Type Description
val1 anything
val2 anything
Returns:number
create()
destroy()
focus()

Put focus on this widget

isFocusable()

Tells if this widget is focusable or not. Used internally by dijit.

Returns:undefined
postCreate()
reset()

Reset the widget's value to what it was at initialization time

undo()

Restore the value to the last value passed to onChange

Events

_onFocus(by)
Parameter Type Description
by String
onChange(newValue)

Callback when this widget's value is changed.

Parameter Type Description
newValue undefined
Error in the documentation? Can’t find what you are looking for? Let us know!