dijit/form/_FormWidgetMixin (version 1.10)

Summary

Mixin for widgets corresponding to native HTML elements such as <checkbox> or <button>, which can be children of a <form> node or a dijit/form/Form widget.

Represents a single HTML element. All these widgets should have these attributes just like native HTML input elements. You can set them during widget construction or afterwards, via dijit/_WidgetBase.set().

They also share some common methods.

See the dijit/form/_FormWidgetMixin 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
  • 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

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 is set. Calls onChange() if appropriate

Parameter Type Description
newValue anything

the new value

priorityChange Boolean
Optional

For a slider, for example, dragging the slider is priorityChange==false, but on mouse up, it's priorityChange==true. If intermediateChanges==false, onChange is only called form priorityChange=true events.

_setDisabledAttr(value)
Parameter Type Description
value Boolean
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

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!