A couple of questions as we're wrapping up development on our form-
First, I'm attempting to build a button that will save the exported XML to a local path, ie, c:\\windows\desktop
I found this: xfa.data.saveXML(); which I put in the click event, but how do I tell it to save to a path? (and while we're at it, specify a file name)
Alternately I tried using the built in buttons -email, HTTP, but I've been unable to find documentation on how to construct the code. I know just about anything can be added to the XML source, but I need a pointer on what the best way to handle this is, and how to construct the instructions to save the path. This is for our administrators to extract the XML and import it into their database.
Second question, What is the best way to allow a user to do a completeness check? I like how the email submit button by default checks all the fields set to "user entered required" and would like to configure a button that similarly performs a completeness check and then either alerts the user that there are fields left, or confirms that the form is complete, perhaps with instructions on what to do next. What is the best way to handle this? The plan for submittal is the user will save the pdf locally and then upload it manually to a server that requires a login, then the administrators will export the XML file and import it into a database.
Thanks for your insight..
Solved! Go to Solution.
Views
Replies
Total Likes
1. You cannot include a path or filename in that statement (unless you certify the document which has issues of its own). The user must select the path and filename (for security reasons). By default it will save the data in an XDP format. You can pass another parameter which will save the file with an xml extension instead.
xfa.host.exportData("", false)
2. Just add a regular button and add code to the click event that will run all of the validations for the form. Assuming that the root node of your form is form1:
form1.execValidation()
This will return a true or false value depending on whether there are validation errors or not. So you coudl combine this with an if statement:
if (form1.execValidate() == true){
//code to cause the submit to happen
submitButtonName.execEvent("click")
} else {
app.alert("There are validation errors in your form!")
}
You woudl hide the real submit button in this instance so the user could not bypass your code.
Hope this helps
Paul
Views
Replies
Total Likes
1. You cannot include a path or filename in that statement (unless you certify the document which has issues of its own). The user must select the path and filename (for security reasons). By default it will save the data in an XDP format. You can pass another parameter which will save the file with an xml extension instead.
xfa.host.exportData("", false)
2. Just add a regular button and add code to the click event that will run all of the validations for the form. Assuming that the root node of your form is form1:
form1.execValidation()
This will return a true or false value depending on whether there are validation errors or not. So you coudl combine this with an if statement:
if (form1.execValidate() == true){
//code to cause the submit to happen
submitButtonName.execEvent("click")
} else {
app.alert("There are validation errors in your form!")
}
You woudl hide the real submit button in this instance so the user could not bypass your code.
Hope this helps
Paul
Views
Replies
Total Likes
Thanks so much for your help so far, Paul
Everything works great, except when trying to use the Export button from Reader. (It works as expected in Pro)
The file has been reader extended, so save works, but our developers need the ability to click that Export button from Reader and get an XML file. Any ideas if this is possible or how the code can be tweaked so it will work for Reader?
Thanks!
Views
Replies
Total Likes
The ability to export data from Reader is a Reader Extensions option that is only available in the server version of the LiveCycle Reader Extensions server. You would have to look into that to accomplish what you want.
Paul
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies