Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!

Add items to a list programmatically and retreave them after saving

Avatar

Former Community Member
Hi,<br />I need to add Items to a dropdown list via javascript, and I would like to store the values in the PDF so when I save it and then re open it, the values are still in the list.<br />I used this function to populate the lists from an array (arrProdotti):<br /><br />function addProd (){<br /> var obj = xfa.resolveNodes("F.Page_1.esportare.prodotto[*]");<br /> for (var i=0;i<arrProdotti.length;i++)//length of the array<br /> for (var e=0;e<12;e++)//number of dropdown lists<br /> { <br /> obj.item(e).addItem (arrProdotti[i][1],arrProdotti[i][0]);<br /> }<br />}<br /><br />This code works fine, but after I close the PDF and re-open it the lists are empty and I have re-execute the code to fill them again.<br /><br />The PDF are enabled with Reader Extension<br /><br />Someone could help?<br />some example code?<br />Thanks
1 Reply

Avatar

Former Community Member
I may not understand your problem or exactly what you need to have happen but I would think that if you need to dynamically populate the list the first time I wouldn't be surprised if you had to do it every time - such as at "form load" or "form initialization" or "field initialization".