I have an XML schema that defines a form I am building. In the schema, I have a repeating section called subject. Within subject, I have a field element called fullname. I have built my form, and added a subform with the field fullname. I bound the subform to the repeating node in the schema and the field to the element I require, and when I preview the form with a sample data file, I do get a variable number of subforms repeat on the form so life is great. Now the problem 😞
I have to repeat the variable number of fullnames two more times throughout the form. When I use the exact same binding, they don't populate the form. Can you bind subsequent fields or subforms in a form to something that is already bound to a field or subform in the form?
I then thought of trying to bind the subsequent occurrences of the data I need to the one(s) already populated in the form, but they don't trigger the subforms to lay down. The following is an example of the datafile:
Unfortunately, because you need the data to be duplicated in 2 other locations in your form, I don't believe you can use "traditional" data binding methods to achieve that unless you used global fields with implicit bindings but this would most likely affect the structure of the objects on your form and may not be desirable if, say, you're using tables to present the data.
Another way to do this is not to use a data connection. Rather, do the data import manually and then populate all instances of the Fullname fields with script. This gets tricky, though, because you'll need to use a button which executes the "xfa.host.importData();" function and then you'll want to add code right after the call, in the button's Click event, to read the data and populate your fields. The problem with that is that there's a timing issue where you'll come back from the "xfa.host.importData();" call before the data is actually loaded into the Data Model and so your script won't work properly.
The solution therefore involves using some AcroForm tricks in order to delay the execution of the script which will read the data from the Data Model and populate the pertaining fields.
Rather than attempting to explain this is words, I've created a sample form which demonstrates how to do this. The form contains a field for the contractID data and then 3 tables which display copies of the Fullname data. After clicking on the "Load Data" button, the Validate event on an invisible text field is used as the trigger to run the "data import" script which populates the fields on the form.
I'll be happy to go into details if you have any specific questions.
That's most likely the problem. Acrobat 7.0 isn't giving you access to the AcroForm field's comb property and that's causing a script error which means nothing beyond that line gets executed. This explains why once you comment-out the line, you finally get the "import data" dialog. The problem is the form won't work without the comb property.
Upgrading from Acrobat 7.0 to 7.0.7 is free... Can you do that?
Thanks Stefan, the form worked, and I was able to figure things out (the acroform trickery with the comb field). It should also be noted that this will not work with the free Reader unless you reader extend the form to allow "import and export of form data". When I first tried the form, nothing happened but after I extended it, the form behaved as it was supposed to.