Expand my Community achievements bar.

Determine Instance # of subform & extra instances made on import?

Avatar

Former Community Member
I am using Adobe Designer v7.0.041126 ... here is what I am doing and trying to accomplish.



I have an order form with 3 pages. Page 1 is the only one shown by default. Page 2 is just a page of additional order lines which can be added to the PDF by clicking a button. Page 3 is an additional page that is only shown when a radio button is selected appropriately.



Page 2 has line numbers (made of text labels) that are dynamically numbered by some javascript in the "initialize" event. This works fine when the form is having data entered into it, but when trying to import form data I am having some problems.



Because I was using _Page2.count property to get the number of instances to great line numbers ... everything is renamed when importing form data. So this is where it would be really helpful to find something like: this.InstanceNumber to get the instance number.



The other problem I am having is that when I import the XML file, it has 3 Pages (1 each of Page1, Page2 and Page3) ... it is generating 4 instances of page2. I looked at the XML and I dont know why it would be doing that.



Any ideas on either of these issues would be greatly appreciated.
6 Replies

Avatar

Former Community Member
Update ... I solved the issue with the numbering ... I used: this.index; to get the instance number and the numbering is corrected.



However, I am still getting duplicate instances of Page2. Here is some more detailed information, hopefully it will help in solving this:



PDF by default is only Page 1. Page 2 can be added infinately by clicking "add lines" button. Page 3 can be added once as a appendix form.



XML data being imported is made up of: 1x Page1, 1x Page2 and 1x Page3.



Upon importing the XML form data I get: 1x Page1, 4x Page2 and 1x Page3. All the data is correct, but pages 3-5 are blank.



Thanks again.

Avatar

Former Community Member
It's difficult to tell exactly what's going on without seeing your form and data but if your data looks like this:



<page1>

<field1>value</field1>

</page1>

<page2>

<field1>value</field1>

</page2>

<page2>

<field1>value</field1>

</page2>

<page2>

<field1>value</field1>

</page2>

<page2>

<field1>value</field1>

</page2>

<page3>

<field1>value</field1>

</page3>


even though all 4 page2 records should fit on a single instance of page2, it'll end-up generating a separate instance of page2 for each page2 record.



If your data file was re-formatted to look like this:



<page1>

<field1>value</field1>

</page1>

<page2>

<field1>value</field1>

<field1>value</field1>

<field1>value</field1>

<field1>value</field1>

</page2>

<page3>

<field1>value</field1>

</page3>


it should give you a single page2 with 4 records on it.



I'm probably way off here without seeing your form and data. I'd be happy to have a look at them if you'd like to send them to dev_info@adobe.com. Please use the thread title as the email title and include your form and data file.



Stefan

Adobe Systems

Avatar

Former Community Member
Thanks Stefan, sent an email with the form & the data. Really appreciate your help with this.



~Matt

Avatar

Former Community Member
That's an interesting form you're developing. It looks very nice.



It took me quite a while to figure-out what was going on but I think I may have figured it out. I inspected the data file you included and saw that there were many instances of the txtPulsaOrderNum field which were empty and located outside the page nodes. Finally, the last instance of this node contained the actual value. Then I looked at the form and saw that there's an instance of txtPulsaOrderNum on each page. After manually removing each empty <txtPulsaOrderNum/> node in the data file, importing the data into the form generates the expected number of pages (only 1 instance of Page2).



The solution, since the txtPulsaOrderNum seems like it should contain the same value in all instances, is to set its Binding Type to
Global by selecting one instance and going to the Object palette's Binding tab. This will result in all instances of txtPulsaOrderNum being linked, any change in value will be automatically replicated across all instances and only a single txtPulsaOrderNum node will be output to the XML data file.



Let me know if this solves your problem.



Stefan

Adobe Systems

Avatar

Former Community Member
Hi,



I am using Adobe LiveCycle Designer 7.1. I have a problem with changing the properties of the instances of the subform that are dynamically created. What i require is, when a new instance of the subform is created, the fields in the subform must be changed to required(Subform.field1.validate.nullTest = "error"). But this property is applied only to the original subform and not the dynamic instances that are created. Can anyone help me with this.

Thank you in advance.