Behind the scenes
You can add XSD-based adaptive forms and fragments in the parent form. The structure of the parent form is same as any adaptive form. When you add an adaptive form as a child form, it is added as a panel in the parent form. Data of a bound child form is stored under the data
root of the afBoundData
section of the parent form’s XML schema.
For example, your customers fill an application form. First two fields of the form are name and identity. Its XML is:
<afData>
<afUnboundData>
<data />
</afUnboundData>
<afBoundData>
<data xmlns:xfa="https://www.xfa.org/schema/xfa-data/1.0/">
<applicantName>Sarah Rose</applicantName>
<applicantId>1234</applicantId>
</data>
</afBoundData>
</afData>
You add another form in the application that lets your customers fill their office address. The schema root of the child form is officeAddress
. Apply bindref
/application/officeAddress
or /officeAddress
. If bindref
is not provided, the child form is added as the officeAddress
subtree. See the XML of the form below:
<afData>
<afUnboundData>
<data />
</afUnboundData>
<afBoundData>
<data xmlns:xfa="https://www.xfa.org/schema/xfa-data/1.0/">
<applicantName>Sarah Rose</applicantName>
<applicantId>1234</applicantId>
<officeAddress>
<addressLine>1, Geometrixx City</addressLine>
<zip>11111</zip>
</officeAddress>
</data>
</afBoundData>
</afData>
If you insert another form that lets your customers provide house address, apply bindref
/application/houseAddress or /houseAddress.
The XML looks like:
<afData>
<afUnboundData>
<data />
</afUnboundData>
<afBoundData>
<data xmlns:xfa="https://www.xfa.org/schema/xfa-data/1.0/">
<applicantName>Sarah Rose</applicantName>
<applicantId>1234</applicantId>
<officeAddress>
<addressLine>1, Geometrixx City</addressLine>
<zip>11111</zip>
</officeAddress>
<houseAddress>
<addressLine>2, Geometrixx City</addressLine>
<zip>11111</zip>
</houseAddress>
</data>
</afBoundData>
</afData>
If you want to keep the same subroot name as the schema root ( Address
in this example), use indexed bindrefs.
For example, apply bindrefs /application/address[1]
or /address[1]
and /application/address[2]
or /address[2]
. The XML of the form is:
<afData>
<afUnboundData>
<data />
</afUnboundData>
<afBoundData>
<data xmlns:xfa="https://www.xfa.org/schema/xfa-data/1.0/">
<applicantName>Sarah Rose</applicantName>
<applicantId>1234</applicantId>
<address>
<addressLine>1, Geometrixx City</addressLine>
<zip>11111</zip>
</address>
<address>
<addressLine>2, Geometrixx City</addressLine>
<zip>11111</zip>
</address>
</data>
</afBoundData>
</afData>
You can change the default subtree of the adaptive form/fragment using the bindRef
property. The bindRef
property lets you specify the path that points to a location in the tree structure of the XML schema.
If the child form is unbound, its data is stored under the data
root of the afUnboundData
section of the parent form’s XML schema.
You can add an adaptive form as a child form multiple times. Ensure that the bindRef
is modified properly so that each used instance of the adaptive form points to a different subroot under the data root.