Expand my Community achievements bar.

Populate DropDown from XML file

Avatar

Former Community Member

Have been reading/testing what I could find on creating a drop down list that is populated from xml file (also tried datasource to access database but have too many issues, such as won't be able to install DSN on multiple machines, plus getting an environment not trusted error).  The XML file will be on a network, updated nightly, all users have rights to folder/file.  Created the test data connections trying both the sample XML method and the XSD, which let me choose the XML associated with it.  Have created a reader extended copy, am opening in AdobeX Pro, but regardless of whether I try to preview in the LiveCycle designer, or open in the reader extended PDF, the drop down list is blank.  Have tried binding a drop down to the datasource field name, and tried simply dragging the field onto the form and making it a drop down.  The XML has 4 columns, and once the 1st column value is selected, the goal will be to write column 2, 3 and 4 values to other fields on the PDF, but my first stumbling block is to populate the dropdown.  Any assistance very welcome, thank you!

3 Replies

Avatar

Level 10

Hi,

Here's a couple of links that might help with getting the drop down to work.

http://forms.stefcameron.com/2006/07/29/dynamic-properties/

http://it.toolbox.com/blogs/enterprise-modeling/dynamic-dropdown-lists-in-adobe-livecycle-designer-3...

And here's a sample that has a dropdown with languages and displays the words for 1,2,3,4, that might help as well.

https://workspaces.acrobat.com/?d=hFpi8EWJF0ejwP*gVKIMAw

This takes XML like;

<codes>

<value id="1" display="English">

<field1>one</field1>

<field2>two</field2>

<field3>three</field3>

<field4>four</field4>

</value>

<value id="2" display="Maori">

<field1>tahi</field1>

<field2>rua</field2>

<field3>toru</field3>

<field4>whā</field4>

</value>

</codes>

and has the following code in the change event of the drop down

var bountId = this.boundItem(xfa.event.newText)

var code = $data.resolveNode("codes.value.[id=="+bountId+"]");

TextField1.rawValue = code.field1.value;

TextField2.rawValue = code.field2.value;

TextField3.rawValue = code.field3.value;

TextField4.rawValue = code.field4.value;

Avatar

Former Community Member

Thank you so much for the help and links, I will check them out, they look very helpful, this will be great. 

Avatar

Level 1

Does anyone know how to populate multiple fields from data binding, most of all of these forms and how to only populate one field of data i am losing the connection when it comes to connecting the second, third, etc fields to the data of the xml?