XForms Actions Elements

Release 2.0 - ...

This section defines the controller layer of XForms, an XML Events-based common set of actions that can be invoked in response to events.

All form controls as well as other elements defined in the XForms specification have a set of common behaviors that encourage consistent authoring and look and feel for XForms-based applications. This consistency comes from attaching a common set of behaviors to the various form controls.

In conjunction with the event binding mechanism provided by XML Events, these handlers provide a flexible means for forms authors to specify event processing at appropriate points within the XForms user interface. XForms Actions are declarative XML event handlers that capture high-level semantics. As a consequence, they significantly enhance the accessibility of XForms-based applications in comparison to previous Web technologies that relied exclusively on scripting.

XForms Action Elements

The table below shows an overview of the action elements.

Action Element Attributes Minimal Content Model
action Common, XML Events, Common Action Attributes Action
setvalue Common, XML Events, Common Action Attributes, Single Node Binding, value PCDATA
insert Common, XML Events, Common Action Attributes, Node Set Binding, context, at, position, origin EMPTY
delete Common, XML Events, Common Action Attributes, Node Set Binding, context, at EMPTY
setindex Common, XML Events, Common Action Attributes, repeat, index EMPTY
toggle Common, XML Events, Common Action Attributes, case case element (optional)
setfocus Common, XML Events, Common Action Attributes, control control element (optional)
dispatch Common, XML Events, Common Action Attributes, name, targetid, delay, bubbles, cancelable name, targetid and/or delay element (optional)
rebuild Common, XML Events, Common Action Attributes, model EMPTY
recalculate Common, XML Events, Common Action Attributes, model EMPTY
revalidate Common, XML Events, Common Action Attributes, model EMPTY
refresh Common, XML Events, Common Action Attributes, model EMPTY
reset Common, XML Events, Common Action Attributes, model EMPTY
load Common, XML Events, Common Action Attributes, Single Node Binding (optional), resource, show resource element (optional)
send Common, XML Events, Common Action Attributes, submission EMPTY
message Common, XML Events, Common Action Attributes, Single Node Binding (optional), level PCDATA | UI Inline

All these action elements also make up the Action Content Set.

Attributes from the Common Attributes group, the Common Action Attributes group and the XML Events group are always optional.
Attributes from the Single Node Binding Attributes group and the Node Set Binding Attributes group are always required, unless stated otherwise.

The model attribute is always of type xsd:IDREF, which means it needs to reference an existing model's id attribute.

Specification

Link to the XForms specification: XForms Actions.

Topics