Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

values ​​loading XML file


Level 4

Hello I have the following xml file loaded into a pdf

my xml file is structured in this way:



          <field code="A">

               <field1 code="100"  />


          <field code="B">

               <field1 code="200"  />




In the first drop downlist I was able to load the field values ​​(A, B, etc.)

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

works well

the problem I have now is how do I load in a second drop downlist, the values (100, 200) ​​from the xml file according to the choice made before?

3 Replies


Level 8

There are a number of ways. Normally values wouldn't be stored as attributes as is in your case, so I find it easiest to use XPath instead of accessing the attribute through the scripting object model.

Put this in the change event of your first drop down where DropDownList2 is the name of your second dropdown:


var elements = XMLData.applyXPath(xfa.data,"root/list/field[@code='"+xfa.event.newText+"']/*/@code");/**/


if (elements.className=="dataValue")



for (var a=0;a<elements.length;a++)





Level 4

Hello thanks for the help, as soon as I get some time I try to use the code


Level 4

hello I tried the code, unfortunately it does not work properly.
The first code example value = "100" is not taken.

Another thing, through a service LCES, I transform my workbench using XDP file in an HTML page the code to populate the drop down list does not work