Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

SubForm with data binding that repeats

Avatar

Avatar
Validate 1
Level 1
CODevGroup
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
CODevGroup
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
CODevGroup
Level 1

02-12-2011

Hello,

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"

Page1SubForm

-- RepeatingNodeSubform

Page2SubForm

-- RepeatingNodeSubform.

XML is as follows

<Employee>

     <Name> XXX </Name>

     <SSN></SSN>

     <DOB></DOB>

</Employee>

<Employee>

     <Name> YYY</Name>

     <SSN></SSN>

     <DOB></DOB>

</Employee>

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?

Thanks in advance!

View Entire Topic

Avatar

Avatar
Give Back 3
Level 2
past-tense
Level 2

Likes

9 likes

Total Posts

85 posts

Correct Reply

10 solutions
Top badges earned
Give Back 3
Give Back
Validate 1
Boost 5
Boost 3
View profile

Avatar
Give Back 3
Level 2
past-tense
Level 2

Likes

9 likes

Total Posts

85 posts

Correct Reply

10 solutions
Top badges earned
Give Back 3
Give Back
Validate 1
Boost 5
Boost 3
View profile
past-tense
Level 2

07-12-2011

Hey again,

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:

EmployeeInformation.page1.Employee.Name

and that the som for the name field on the second page is:

EmployeeInformation.page2.Employee.Name

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:

_Employee.setInstances(page1._Employee.count);

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:

this.rawValue = xfa.form.resolveNode(this.somExpression.replace("page2","page1")).rawValue;

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,

- Scott