Modifying the User Interface
Using Adobe Dialog Manager (ADM) in Acrobat JavaScript
10
var myDialog =
{
initialize: function(dialog)
{
// Set up and store the values in list_box sub1:
dialog.load({
"sub1":
{
// Note: positive value represents the selected item
"one": -1,
"two": -2,
"three": +3, // currently selected item
"four": -4
}
});
},
commit: function(dialog)
{
// Retrieve the values stored in list_box sub1:
var elements = dialog.store();
// Iterate through items and take actions as needed
for (var e in elements["sub1"])
// If the value is positive, it was selected:
if (elements["sub1"][e] > 0)
{
// display the list value selected:
app.alert("You chose:\n" + e);
// call a related function for the selection
rc = elements["sub1"][e];
ListHandler(rc);
}
},
// event handler for butn button clicks
"butn": function(dialog)
{
app.alert("JavaScript ADM Dialog in Acrobat 7.");
},
Acrobat JavaScript Scripting Guide
167