Hello,
I want to have my XFA form connect to a server when the form is first opened and have the server return both XML data to populate the form as well as other custom XML I can use to dynamically add form fields to a given subform or manipulate their event handlers. In essence, I want to make it such that an XML feed from a custom server script I write can both populate the XFA form and modify its behavior. The XFA template file itself will have reader extensions enabled, such that end users can download the form, watch it auto-populate itself, save their form data locally within Adobe Reader and then transmit their signed changes back to the server when complete. Is this possible? From all I've read, it seems so, but it's tough to navigate all the documentation and figure out which methods work with XFA vs. AcroForms, which will be allowed through default security measures without going to an enormous amount of extra effort (I've given up on using the Net.HTTP object because of this). Isn't there a simple way in JavaScript to connect to a server, grab XML data (I would have complete control over this XML, so it could be structured any way it needed to be) and use it to populate a form? Also, this needs to be a generic solution, not a specific one, since I'll need to apply this methodology to a lot of different forms.
Thanks for any help!
1. Dynamic XFA forms are designed specifically for dynamic field creation. You can create fields in the template that are not vissible, or do not exist on the displayed form. Then using JavaScript you can make the fields visible, or create new instances of the fields. Read about it and try it out.
2. Forget about Net.HTTP. This object is about a useless at they get. The only reasonable way for a form to communcate with a server script is through the "doc.submitForm()" function, which does HTTP request/response.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script