Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

xfa.datasets.data does work with HTML rendered forms?????

Avatar

Former Community Member
Hi gurus!



I have created a pdf form with xml data filling in textfields and dropdownlist.



Using javascript...



var objDataNodes = xfa.datasets.data.form1.subform1.MyData.resolveNodes("Name[*]");



var length = objDataNodes.length;



for (var i=0; i < (length); i++){

this.addItem(objDataNodes.item(i).value);

}



and dataconnection binding



Thanks to the forum examples!



This works great if i render to a pdf form.



But the drop-down list doesnt work if i render to a html form!! :-(

I obtain a javascript error with the xfa.datasets.data is null or not valid object.



Please Help me!!



Thanks in advance.

Julio César
3 Replies

Avatar

Former Community Member
Does it work if you set your script to run on client and server?



H.

Avatar

Former Community Member
Great! Thanks a lot. Setting to run on client and server works!



But it is strange: i obtain the same error message, but the drop-down list is filled correctly. How can i remove the error message?



"javascript error: 'xfa.datasets.data' is null or is not an object[...]"



One more strange: if i remove the databinding in designer, the drop-down list is filled again but the error message is shown and the first value of the drop-down list is blank.



Thanks in advance.

Julio César.

Avatar

Former Community Member
OK, i solved it!



For other people who want to use html rendered forms:

Set all your initialize scripts with xfa code to run only at server.



Good luck!