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

Would some help explain how to modify example in turorial

Michael Frommer
Registered: Apr 3 2009
Posts: 80

I have one dropdown box for which I want to script about 20 'text' values and associated 'bound' values. Since that list may need to be modified in the future, I presume it would be easier to script this than enter the text and their 'bound' values (which will also be text strings rather than numeric values) on the object's field and binding tabs.

I have read the tutorial [url=http://www.acrobatusers.com/tutorials/2007/js_list_combo_livecycle]Programming List and Combo fields in Acrobat and LiveCycle forms - Part 1[/url] but I can't seem to figure out how to modify it for use with only one dropdown and a text field. The last part is easy, so that my text field.rawvalue = my dropdown.boundItem(xfa.event.newText).

But how do I change the 'Master List'? I don't need one dropdown to specify the list of another dropdown.

Freelancer
Registered: May 26 2009
Posts: 71
Hi,

you only need to set the list as follows:

1. create listbox "LBName" in your doc
2. then in JavaScript
create list you want to appear in List box, format is
var lst = [["Item 1", "one"], ["Item 2","two"], ["Item 3","three"]];
fĂ­rst value is text in listbox and second is export value
3. set values into listbox as:
this.getField("LBName").setItems(lst);

That's it. The example you gave a link, is little tricky, because
the author uses 'advanced' way to do things (named lists an so on).
My opinion is that examples should be as simple as possible,
like those famous 'Hello world' examples...

Freelancer

According to most IT HelpDesk people, the most common reason for user error (regardless of Operating System) is ID 10T.

Michael Frommer
Registered: Apr 3 2009
Posts: 80
Freelancer,

I'm not sure about the formatting of the variable that lists the text and values, but the final line wont work in LCD. The 'setItems' function is used for an acroform and is not supported in LCD. I need the xfa solution.