XFA Specification
Chapter 9, Automation Objects
Events
305
The object whose change of state triggers the event is called the
target.
There are six general classes of
events, distinguished by the type of target. Some events in different classes share the same name because
they are similar in function, however they are distinct events because an event is distinguished by both
name and target. In addition calculations and validations are very much like events and can be treated as
special types of events.
This section describes the types of events assigned to each class of event.
Application Events
Application events are triggered by actions of the XFA application. Because application events are not
directly linked to user actions, they are triggered in both interactive and non-interactive contexts. The
script in an application event can reference the event object using the SOM expression
xfa.host
, or the
alias
$host
, as described in
“Internal Properties and Methods” on page 92
The application events are as follows:
docClose
This event fires at the very end of processing if and only if all validations succeeded. Success in this
case is defined as generating nothing worse than a warning (no errors). Note that this event
comes too late to modify the saved document; it is intended to be used for generating an exit
status or completion message.
docReady
This event fires before the document is rendered but after data binding. It comes after the
ready
event associated with the Form DOM.
postPrint
This event fires just after the rendered form has been sent to the printer, spooler, or output
destination.
prePrint
This event fires just before rendering for print begins.
postSave
This event fires just after the form has been written out in PDF or XDP format. It does not occur
when the Data DOM or some other subset of the form is exported to XDP.
preSave
This event fires just before the form data is written out in PDF or XDP format. It does not occur
when the Data DOM or some other subset of the form is exported to XDP. XSLT postprocessing, if
enabled, takes place after this event.
DOM Events
DOM events trigger when a DOM changes state. Because they are not directly linked to user actions, they
are triggered in both interactive and non-interactive contexts.
A script binds to a DOM event by expressing a
ref
property whose value is a SOM expression pointing to
the DOM. For example, the value
xfa.form
(or its alias
$form
) binds to the Form DOM.
The following DOM events are defined:
Home Index Bookmark Pages
Pages: Home Index All Pages