Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Is there some magic behind event.target.importTextData() that I'm missing?

$
0
0

Hi All

 

I'm busy building a form for a client who needs to import a portion of the form from a local file. The scenario is as follows:

1. User will fill in some portions of the form

2. Then the user will import some data which will populate a table in the form

 

Since I don't want to wipe all the data that the user has captured, I can't use xfa.host.importData.

 

As a result, I'm using the loadXml method on the data DOM, followed by a remerge.

This works well, however, for loadXml to work I have to supply the XML as a string. My workaround was to create a hidden text field and load the XML from there. It works nicely.

 

Last remaining problem is getting the xml from the file system into the text field.

 

There's limited information about how to do this, but it seems I need to use the acrobat method importTextData(), which seems simple, but never works.

 

I've followed Stefan's advice at this link: Import data from text file . Seems simple but simply does not work

 

My code is as follows:

var returnCode = event.target.importTextData();

xfa.host.messageBox("ReturnCode: " + returnCode);

 

I always get a returnCode of 1, which means "Error: Cannot Open File"

 

What seemed like a simple issue, is turning into a nightmare, so I'm assuming I'm missing something obvious here.

 

Any help will be appreciated

 

PS. I'm also open to other suggestions

 

Greg


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>