These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

xfa.host.importData

riccarrasquilla
Registered: Sep 24 2008
Posts: 27

I'm trying to use xfa.host.importData() to import data from a XML file into a field upon initialization of the page.

When the file is open, a dialog box appears and asks to open the XML file. How do I format the XML file to match the form. For example, in the form, I have a fields with the names Business_Name, Strap, Job_Address , etc. How do I build the XML file to match those fields?

thx

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The easiest way, and the proper way, to do this is to setup the XML file, or it's schema, as a "Data Source" for the form. then set the binding on the fields to match the XML fields. Then the form will import and export XML data in the grammar of the original XML.


Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

riccarrasquilla
Registered: Sep 24 2008
Posts: 27
thanks for the reply. i've figured out that i should use acrobat forms for these simpler forms.

do you know how i can have one button fire an event belonging to a second button?

ie. button one is clicked and runs a script. if the script is successful, button one tells button to to fire button two's click event.

i believe livedesigner has an evecEvent() method. does acrobat forms have something similar?

thx again
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You cannot generally force fire events directly in Acrobat JavaScript, it does not have anything similar to "execEvent", but you can cause some field events to be fired. For example, you can force a focus change on form fields which fires the "OnFocus" and "OnBur" events. When you change a fields value it fires calculation events all over the form, followed by validate and format events.

why do you want to fire an event indirectly?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

riccarrasquilla
Registered: Sep 24 2008
Posts: 27
why? i was able to do it in livedesign and was curious if i could do it in acrobat. thx for the reply. i really appreciate the help.