These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Custom Dialog Box : item list box to be filled dynamically

lishapeter
Registered: May 20 2008
Posts: 9

Hi,

I wish to create a dropdown list/item-list box inside a custom dialog box or a popup.

This dropdown list or item list box is intended to hold a large number of values.
I read through the samples for dialog object of app object’s execDialog() method, but in these there are hard-coded values assigned to the list box.

Please let me know how to pass either an array into this or set the values using a for loop.

Thanks!!
Lisha

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The values in a dialog list box are set with an object that contains all of the list items. There is no difference in how this is done before the dialog is displayed, or at runtime. The "list object" can be setup and manipulated outside the dialog object, but it can only be loaded into the dropdown while the dialog is running.

For Example:
// Setup initial listvar myList = {apple:-1,pear:-1,grape:1};// Load into dropdowndialog.load({"pop1":myList}); // Modify list at some later timedelete myList["apple"];myList["banana"] = 1;// Reloaddialog.load({"pop1":myList});

Notice the use of the "dialog" object. This is only available in functions in the Dialog Literal, called when the dialog is running. For example, the "initialize" function, or any of the action functions associated with a dialog element. But you can certainly create the drop-down list object outside of the dialog literal, so that it can be manipulated before the dialog is run.

Have you looked at [url=http://www.windjack.com/products/acrodialogs.php]AcroDialogs[/url]? This tool makes creating the dialogs much, much easier.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script