Avatar

Level 1

All,

Full disclosure here, this is my first ever post to an Adobe message board, and I have been working with Adobe LiveCycle ES4 for about 2 solid months.  I have a separate program that will send a report file (in this case an Excel file) to a shared network folder, and I would like to leverage that data into my Dynamic form.  I have been using a XML tools add in, and developer tools in Excel to export an XML file I can use in LiveCycle.

Example Schema:

<?xml version="1.0" encoding="UTF-8" standalone="true"?>

-<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

     -<Row>

          <Thing1>ABCD</Thing1>

          <Thing2>1234</Thing2>

     </Row>

     -<Row>

          <Thing1>DEFG</Thing1>

          <Thing2>1357</Thing2>

     </Row>

     -<Row>

          <Thing1>HIJK</Thing1>

          <Thing2>2468</Thing2>

     </Row>

Again my JavaScript brain is still in it's infancy,  but in my form I theoretically want to import data and output a respective <Thing1> to at least one object text field, one called say <Thing1Field>.   Maybe dynamic binding isn't at all what i need to do in this instance, please read on.

What I am hoping, or attempting, to do is have an end user type a number into a number field called "Thing2Field". They click a button to get the corresponding <Thing1> in the same row as a matching <Thing2> outputed to a text field called "Thing1Field".  Make sense?  My fruitless attempts:

Root.#subform[0]::initialize - (JavaScript, client)

xfa.host.messageBox("Please select data to import to form.","Attention", 3,1);

xfa.host.importData();

Root.#subform[0].Button1::click - (JavaScript, client)

<all of the stuff>

I continue to bang by virtual Javascript head against the wall in trying to figure out what <all of the stuff> could be and where to start.  I am fairly certain if I can figure out how to get the imported data into a declared variable I can work that into a 'for' loop with some conditional statements in order to set the raw value of that text field.  My vocabulary isn't the greatest yet and a lot of the methods people come up with are amazing.  I am really looking for an example.

Some may ask why I am using the .importData(); method.  Long term in building this form I would like to create a representative node in which this imported data goes into.  I have read that importing data from XML goes directly into the root.data?? node.  If you were to import a second file it would overwrite the original becuase how the method and the DOM is setup. The data file I am working with in this example updates not so frequently and is in a different 'system' than another data file I would like to import.  This other file would update frequently and has a lot more data present, it wouldn't be bound to the form but I need to call on the data to populate certain fields from it. 

I am aware LiveCycle allows multiple instances of database connections through SQL and such, which we are moving toward, however I need to get a current working model to allow us to prove viability.  Any help you could provide would be of great assistance.  Thanks in advance for your time.

Alex