Name
action
Synopsis
This element is a wrapper for other XForms Actions. It contains child elements that are executed in sequence.
action
can be used like this:
<action ev:event="DOMActivate"> <setvalue ref="email/contact" value="email/admin"/> <message level="ephemeral">Synchronized email addresses</message> </action>
Note
One concept that comes into play in more advanced XForms scenarios is what the specification calls "deferred updates.” This feature is intended to reduce the potentially expensive computation that can occur through an XForms Action, as changes to the instance data can trigger a display refresh, a recalculation, a revalidation, or a reconstruction of the dependencies.
Deferred updates occur only through the action
container element. It can be thought of as a switch that temporarily
turns off the expensive processing, handles the child elements, and
then catches up on any processing that still needs to be done. In
this way, for instance, a series of insert
actions, when placed inside an action
element,
wouldn’t require a full recalculation for each
insert—just one to ensure consistency at the end.
Deferred updates apply to
insert
,
delete
, and setvalue
.
Warning
Because of the way the XML Events defaulting works, placing
ev:event
attributes on XForms Action elements
inside action
will have no effect. Instead, the
attribute should be placed on the action
element
itself—the XForms Actions as child elements will still run
within the context of the action
.
Get XForms Essentials now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.