I have a subform that is bound to a node in XSD which will have mutilate occurrences at runtime. The subform has just one textfield which prints the name of such item. My form has three pages and I need to use this same subform on Page 1 and Page2. Problem is that it works on Page1 but does not work on Page 2.
Form is designed as follows"
XML is as follows
<Name> XXX </Name>
RepeatingNodeSubform on Page1 works fine but on page2 does not display anything. If bound to another repeating node, it works on Page2.
What could be an issue? Also, is there any restriction such as on the same form there can not be two subforms bound to the same node?
Sorry for the delay in getting back to you; I had to wait for my break.
Alright, from everything you've said, I seems to me that your only real option would be to use some code to copy the values from page one to all of the other pages. Seeing as your users won't be making any changes and you will just be doing data bindings, I would suggest either making all of your fields read-only, or possibly printing to a virtual pdf printer once you've imported the date in order to 'flatten' your pdfs before sending them to your users... this is to prevent them from accidentally making changes.
Alright, so I've made the following assumptions:
- The repeatable subform on page one and page two are exact duplicates of one another. All fields and subforms use the same names, and the only difference between them is that one is on page1 and the other is on page2.
- This means that the som for two are the same except for the page. i.e.: the som to the Name field on the first page is:
and that the som for the name field on the second page is:
If this is the case, then you need to add the following scripts to make the import also trigger the copy to the other instance of the table:
in the page2 initialize event, add:
The above will add as many blank rows to the repeatable subform on page two as needed to include all of the records from page one. Then in each field on the second page's repeatable subform, in the initialize event put:
The above code looks for a field on page 1 that exactly matches the some expression of the current field (aside from the page being called page1 instead of page2), and copies the value of the field to itself.
I've tested it in a form I just made and it's working fine on my end.
let me know if you need any further instructions, or if your form uses different names for the pages, aside from page1 and page2.
I have to run as my break is ending soon. Best of luck,