dojox/form/manager/_NodeMixin (version 1.10)

Summary

Mixin to orchestrate dynamic forms (works with DOM nodes).

This mixin provides a foundation for an enhanced form functionality: unified access to individual form elements, unified "change" event processing, and general event processing. It complements dojox/form/manager/_Mixin extending the functionality to DOM nodes.

See the dojox/form/manager/_NodeMixin reference documentation for more information.

Method Summary

  • destroy() Called when the widget is being destroyed
  • formNodeValue(elem,value) Set or get a form element by name.
  • inspectFormNodes(inspector,state,defaultValue) Run an inspector function on controlled form elements returning a result object.
  • registerNode(node) Register a node with the form manager
  • registerNodeDescendants(node) Register node's descendants (form nodes) with the form manager
  • unregisterNode(name) Removes the node by name from internal tables unregistering connected observers
  • unregisterNodeDescendants(node) Unregister node's descendants (form nodes) with the form manager

Methods

destroy()

Called when the widget is being destroyed

formNodeValue(elem,value)

Set or get a form element by name.

Parameter Type Description
elem String | Node | Array

Form element's name, DOM node, or array or radio nodes.

value Object
Optional

Optional. The value to set.

Returns:Object | null | string | function | undefined

For a getter it returns the value, for a setter it returns self. If the elem is not valid, null will be returned.

inspectFormNodes(inspector,state,defaultValue)

Run an inspector function on controlled form elements returning a result object.

Parameter Type Description
inspector Function

A function to be called on a form element. Takes three arguments: a name, a node or an array of nodes, and a supplied value. Runs in the context of the form manager. Returns a value that will be collected and returned as a state.

state Object
Optional

Optional. If a name-value dictionary --- only listed names will be processed. If an array, all names in the array will be processed with defaultValue. If omitted or null, all form elements will be processed with defaultValue.

defaultValue Object
Optional

Optional. The default state (true, if omitted).

Returns:object
registerNode(node)

Register a node with the form manager

Parameter Type Description
node String | Node

A node, or its id

Returns:Object | function

Returns self

registerNodeDescendants(node)

Register node's descendants (form nodes) with the form manager

Parameter Type Description
node String | Node

A widget, or its widgetId, or its DOM node

Returns:Object | function

Returns self

unregisterNode(name)

Removes the node by name from internal tables unregistering connected observers

Parameter Type Description
name String

Name of the to unregister

Returns:Object | function

Returns self

unregisterNodeDescendants(node)

Unregister node's descendants (form nodes) with the form manager

Parameter Type Description
node String | Node

A widget, or its widgetId, or its DOM node

Returns:Object | function

Returns self

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