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

assigning data (from the dataview) to the javascript array

watson23
Registered: Mar 25 2008
Posts: 37
Answered

Hi,
basically what I'm trying to do is to assign data (not stored in any container on a form) directly from the dataview to a javascript array, e.g.:
var myArray = []

and here's the dataview that I have:
- Z_SFP_MYFORM
- INFO
- GT_INFO
- DATA
- NAME
- ADDRESS
- COUNTRY

Let's say I'd like to have all the instances of the NAME field assigned directly to myArray - what should I do? I repeat: this data isn't stored in any container (textfield or any other kind of field) on the form.
I've already looked through the SOM reference but it didn't help as much as I had expected, so I'm still struggling with getting the things done.
Any help will be greatly appreciated
Regards
T.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The "Data View" tab in LiveCycle Designer is a tool for connecting the form fields to an external data source, which could be a DB, an XML file, or a web service. Using the Data View tab creates an associated structure in the XFA. Click on your XFA tab and you'll see it.

Each of the different data sources has it's own structure in the XFA. But there is not real data here. These are services for connecting to the external source and acquiring data, the "sourceSet" model has functions for acquiring data from a DB, and the "connectionSet" model has function for acquiring data from a web service. For a JavaScript example of how to get into this structure look at the code in the initialize event for the "Data DropDown" field. It's in the Custom Library tab.

But the data view info can also serve to organize data in the "datasets" model, which is where, for example, you'd find mutiple instances of the "name" data associated with mutiple "name" fields on the form.

You can access any of the XML nodes associated with these XFA structures though JavaScript. But the SOM reference is the wrong place to look. You need the XFA Object Reference and the Architecture document, You can find both here:
http://partners.adobe.com/public/developer/xml/topic.php

But you'll also get the most relevant, and immediate info by examining the form's XML.

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

watson23
Registered: Mar 25 2008
Posts: 37
Thank you for your long and thorough explanation and most of all thank you for showing me the right track to follow. This stuff is quite new to me, so any help is really precious to me.
Thanks again,
regards
T.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You're welcome, and good luck. You're attempting some pretty advanced stuff and if you hadn't already noticed, the documentation is awful.

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

watson23
Registered: Mar 25 2008
Posts: 37
As for a newbie - it's not easy to me (static & dynamic forms is a totally different story - way easier than the interactive ones)... But I'm definitely willing to learn & gain some new knowledge. Fortunately there is the Internet and the experts (such as yourself) that we all can count on.
Greetings
T.