10
Modifying the User Interface
Using Adobe Dialog Manager (ADM) in Acrobat JavaScript
– Popup Control Button
– Popup Spin Edit Control
– Password Text Edit
Access to ADM through JavaScript
The
app
object’s
execDialog
method is the Acrobat JavaScript method used to execute
ADM dialogs. The method requires a single parameter: an object literal known as a
dialog
descriptor,
which contains properties and method handlers for all the dialog elements.
An instance of the
Dialog
object is passed to the method handlers. The
Dialog
object
has two important methods: the
load
method is used to initialize dialog elements, and the
store
method retrieves values stored in dialog elements.
The dialog handlers are described below in
Table 10.2:
T
ABLE
10.2
Dialog Handlers
Handler
Description
Method that runs when the dialog is created
Method called when validating field values
Method called when OK button is selected
Method that runs when the dialog is destroyed
Method called when an element’s
itemID
property is
modified
initialize
validate
commit
destroy
itemID
A dialog descriptor is a tree consisting of a root and child nodes. The root is an object literal
containing the properties shown below in
Table 10.4,
and each child node is a dialog
element containing the properties shown below in
Table 10.5.
In addition to the standard
properties described in
Table 10.5
for the
static_text
,
edit_text
,
ok
,
ok_cancel
, and
ok_cancel_other
elements. These are listed below in
Table 10.3:
162
Acrobat JavaScript Scripting Guide