Skip to main content
December 16, 2016
Answered

How to connect dialog box control with dynamic data

  • December 16, 2016
  • 3 replies
  • 1703 views

Hi,

I am creating a dialog box with list box.  I wanted to display the bookmark name in the list box with the dialog box.  is this possible to do this using adobe acrobat javascript?

Thank you,

Ariv

[Moved from non-technical Forum Lounge to specific Program forum... Mod]

[Here is the list of all Adobe forums... https://forums.adobe.com/welcome]

This topic has been closed for replies.
Correct answer try67

Hi,

It is working.  Thank you.

I am having another doubt in insertchild bookmarking.

I am having bookmark hieraric like this

Fruits

     apple

     Mango

     Banana

     Grapes

Vegetable

     Carrot

     Beans

     Radish

     Brinjal

    

If I wanted to insert a bookmark in between Banana & Grapes.  I used insertchild method.  But item is not inserted correctly.  can you guide me on this.

Thank you

Ariv


It would be something like this:

this.bookmarkRoot.children[0].createChild({cName: "Kiwi", nIndex: 3});

Edit: I changed it to createChild. I think it's easier to do it like that.

3 replies

March 30, 2017

I have tried that.  if I am doing like that it is coming like

1. aaa

10.bbb

11.ccc

2.ddd

.

.

.

etc....

is there any other way to display this like

1. aaa

2.bbb

3.

10.bbb

11.ccc

Thank you for your reply...

Ariv

try67
Community Expert
Community Expert
March 30, 2017

Use "01", "02", "03"... "10", etc.

April 3, 2017

Hi,

It is working.  Thank you.

I am having another doubt in insertchild bookmarking.

I am having bookmark hieraric like this

Fruits

     apple

     Mango

     Banana

     Grapes

Vegetable

     Carrot

     Beans

     Radish

     Brinjal

    

If I wanted to insert a bookmark in between Banana & Grapes.  I used insertchild method.  But item is not inserted correctly.  can you guide me on this.

Thank you

Ariv

March 30, 2017

Hi,

Thank you for your reply.

I have another doubt to discuss.

I have added list box in dialog.

I have added items dynamically.

while opening the dialog the items are sorted alphabetically.

I don't want to sort the items in dialog.

can you help me on this.

Thank you

Ariv

try67
Community Expert
Community Expert
March 30, 2017

There's nothing to do about that.

You can add "1.", "2.", etc. before the items to force them to appear in

the order you want, but that's it.

Inspiring
December 16, 2016

What bookmark name? It is possible to include a list box in a custom dialog and populate it with items.

December 22, 2016

I am having a pdf with bookmarks.  this will change for each pdf file.  I wanted to design a dialog box with list box control that list box needs to display the all bookmark names.

is it possible?

Inspiring
December 22, 2016

Yes, that's possible. If there are nested bookmarks, it will be a complicating factor though since list boxes don't support nested items. A hierarchical list does though.

To get the bookmark names, look in the Acrobat JavaScript documentation for information on the doc.bookmarkRoot property, and the various properties associated with the Bookmark object. It includes some sample code that should be helpful.

The documentation and sample code for the app.execDialog method will also be helpful in learning more about how to use a list_box and hier_list_box controls in a custom dialog.

If you find that you need more help, post again and include some code that you've tried.