Avatar

Level 2

Hello -

I am trying to make a form that repeating subform elements.

See Picture:

Subform.jpg

I wrapped the repeating elements in a positioned subform, that is then wrapped in subform container (another subform that is set to "flowed" to allow the repetition of the wrapped positioned subform.

The effect looks like this:

Form.jpg

(You can see the dynamic repeating parts at the bottom)

Everything works as it should - but I cannot figure out how to bind the data elements to my schema.

If I explicitly bind each data element in the bottom subform directly to a schema element, then if a user fills out one subform, all the other instances prepopulated with the information in the first - so that is no good.

If I explicitly bind the "Containing subform" to my schema (and leave the contained subform as "normal") - then I get unexpected results in the resultant XML.

When I bind the "UserDesigneeContainer" form object, to the element in the same name - here is what the schema looks like:

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

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="ProviderAccessSiteRequestSchema">

    <xs:complexType>

          <xs:sequence>

               <!-- Facility / Practice Elements -->

               <xs:element name="FacPracNm" type="xs:string" />

               <xs:element name="FacPracLn01Ad" type="xs:string" />

               <xs:element name="FacPracCityAd" type="xs:string" />

               <xs:element name="FacPracStateAd" type="xs:string" />

               <xs:element name="FacPracZipAd" type="xs:string" />

               <xs:element name="TaxIDNo" type="xs:integer" />

               <xs:element name="SiteAdminEmailAd" type="xs:string" />

               <xs:element name="SiteAdminNm" type="xs:string" />

               <!--Designee Information Subform-->

               <xs:element name="UserDesigneeContainer">

                    <xs:complexType>

                         <xs:sequence>

                              <xs:element name="UserDesigneeSubform">

                                   <xs:complexType>

                                        <xs:sequence>

                                             <xs:element name="UserFirstNm" type="xs:string" />

                                             <xs:element name="UserLastNm" type="xs:string" />

                                             <xs:element name="UserAddChangeDelIn">

                                                  <xs:simpleType>

                                                       <xs:restriction base="xs:string">

                                                                <xs:enumeration value="Add"/>

                                                                 <xs:enumeration value="Change"/>

                                                                 <xs:enumeration value="Delete"/>

                                                       </xs:restriction>

                                                  </xs:simpleType>

                                             </xs:element>

                                             <xs:element name="UserEmailAd" type="xs:string" />

                                             <xs:element name="UserTelNo" type="xs:string" />

                                        </xs:sequence>

                                   </xs:complexType>

                              </xs:element>

                         </xs:sequence>

                    </xs:complexType>

               </xs:element>

          </xs:sequence>

    </xs:complexType>

  </xs:element>

</xs:schema>

The problem with my schema - is that the XML outputs like this (assuming that there are 2 subforms on the page)

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

<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/"><xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">

<xfa:data>

<Form>

     <ProviderAccessSiteRequestSchema>

          <FacPracNm>Facility Name</FacPracNm>

          <FacPracLn01Ad>1234 Facility St</FacPracLn01Ad>

          <FacPracCityAd>Businesstown</FacPracCityAd>

          <FacPracStateAd>NY</FacPracStateAd>

          <FacPracZipAd>12345</FacPracZipAd>

          <TaxIDNo>000000000</TaxIDNo>

          <SiteAdminEmailAd>test@name.com</SiteAdminEmailAd>

          <SiteAdminNm>test name</SiteAdminNm>

    

          <UserDesigneeContainer>

               <UserDesigneeSubform>

                    <UserFirstNm/>

                    <UserLastNm/>

                    <UserAddChangeDelIn/>

                    <UserEmailAd/>

                    <UserTelNo/>

               </UserDesigneeSubform>

           </UserDesigneeContainer>

</ProviderAccessSiteRequestSchema>

</Form>

</xfa:data>

<dd:dataDescription xmlns:dd="http://ns.adobe.com/data-description/" dd:name="Form">

<Form>

     <ProviderAccessSiteRequestSchema>

          <FacPracNm/>

          <FacPracLn01Ad/>

          <FacPracCityAd/>

          <FacPracStateAd/>

          <FacPracZipAd/>

          <TaxIDNo/>

          <SiteAdminEmailAd/>

          <SiteAdminNm/>

           <UserDesigneeContainer>

               <UserDesigneeSubform>

                    <UserFirstNm/>

                    <UserLastNm/>

                    <UserAddChangeDelIn/>

                    <UserEmailAd/>

                    <UserTelNo/>

               </UserDesigneeSubform>

            </UserDesigneeContainer>

     </ProviderAccessSiteRequestSchema>

</Form>

</dd:dataDescription>

</xfa:datasets>

</xdp:xdp>

So the issue here is twofold:

1.  What does the entire form appear twice in the XML output rather than just the repeating subform area?

2.  Why are the subform form elements populating the XML?

Any help on this would be greatly appreciated.

I will be more than happy to answer any clarification questions if what I have stated is not clear.

Thanks in advance -

Ben Lyons