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

06-12-2011

Hey there,

I deleted the sample that I built yesterday, and I don't have the time to build a new one today. I can, however, tell you how I got it to work:

Your xml  is as follows:

<Employee>

     <Name> XXX </Name>

     <SSN></SSN>

     <DOB></DOB>

</Employee>

<Employee>

     <Name> YYY</Name>

     <SSN></SSN>

     <DOB></DOB>

</Employee>

I assume that you want XXX on page1 and YYY on page 2... additionally, I assume that each page can have multple employee elements bound to them... hense the repeatable subform with the name field. The issue that you're seeing is that Adobe has no way of grouping which employee elements go together. In your XML, it looks like both employee elements are siblings. You need to add a parent element to the xml that groups the particular elements together. the data from my form looked like:

<?xml version="1.0" encoding="UTF-8"?>

<EmployeeInformation>

    <Employees>

        <Employee>

            <Name>Sur1.1</Name>

            <SSN>SNN1.1</SSN>

            <DOB>DOB1.1</DOB>

        </Employee>

        <Employee>

            <Name>Sur1.2</Name>

            <SSN>SNN1.2</SSN>

            <DOB>DOB1.2</DOB>

        </Employee>

        <Employee>

            <Name>Sur1.3</Name>

            <SSN>SNN1.3</SSN>

            <DOB>DOB1.3</DOB>

        </Employee>

    </Employees>

    <Employees>

        <Employee>

            <Name>Sur2.1</Name>

            <SSN>SNN2.1</SSN>

            <DOB>DOB2.1</DOB>

        </Employee>

        <Employee>

            <Name>Sur2.2</Name>

            <SSN>SNN2.2</SSN>

            <DOB>DOB2.2</DOB>

        </Employee>

    </Employees>

</EmployeeInformation>

In my form, I changed the form name to EmployeeInformation, giving me the root element... I named both page 1 and page 2 to Employees (note the 's' at the end), giving me a parent element for the actual Employee (no 's') element. Each page had a repeating subform called employee. All other subforms had their databindings set to 'no data binding'.

As you can see, my XML has two sets of employee data, each contained within an 'Employees' parent. Adobe sees this, then binds the first instance of employees to the first repeatable subform, and binds the second to the second.

So, yes, the subforms and pages had the sme name, but it still required some way to determine which elements went to which page.

As you've pointed out, though, this is not the intended use, and I can easily see Adobe mixing up the 'page' order of the data for the two repeating subforms. Without unique names, you can only cross your fingers and hope that the pdf binds correctly.

Where are you getting your data from? Is there any way that you can transform the data before binding it to your form. If you can, then you can restructure the data to use unique names, then create your form to use these unique names. It would prove to be a whole lot more stable in the long run.

- Scott