XFA Specification
Chapter 8, Dynamic Forms
Data Binding for Dynamic Forms
264
The template for the dynamic purchase order on
page 261,
omitting decorative elements, is as follows:
<template …>
<subform name="PO">
<field name="PO_Date" …> … </field>
<field name="ReqNo" …> … </field>
<field name="Vendor_Code" …> … </field>
<field name="Vendor_Name" …> … </field>
<field name="VendAddr1" …> … </field>
<field name="VendAddr2" …> … </field>
<field name="VendAddr3" …> … </field>
<subform name="Detail">
<occur max="-1"/>
<field name="Item"…> … </field>
<field name="Quantity"…> … </field>
<field name="Units"…> … </field>
<field name="Unit_Price"…> … </field>
<field name="Total_Price"…> … </field>
</subform>
<field name="Sub_Total"…> … </field>
<field name="Tax"…> … </field>
<field name="Total"…> … </field>
<subform name="Delivery">
<occur min="0"/>
<field name="Del_Instrctn"…> … </field>
</subform>
</subform>
</template>
The
Detail
subform has no maximum occurrences and defaults to a minimum of one. This is typical for a
subform corresponding to one in a list of records. The
Delivery
subform has no minimum occurrences
and defaults to a maximum of one. This is typical for a record which is optional.
The DOM relationships for this example are not shown here because the drawing would not fit in the
space available.
The Occur Element
Each subform and subform set object has an
occur
property which has three sub-properties,
min, max,
and
initial.
It governs how many iterations of the subform or subform set are required and how many are
permitted.
In a template the occur property is expressed as an
occur
element. It can be the child of a subform or
subform set. When the
occur
element is missing, all of the sub-properties default to 1. If the element is
present but any of its attributes is missing, the sub-property associated with that attribute defaults to 1.
The initial property
The initial property determines how many copies of the subform or subform set are included in the Form
DOM as siblings during an empty merge. The value of this property must be a non-negative integer. For
example, consider the following template fragment:
<template>
<subform name="jointFiling">
<subform name="spouse">
Home Index Bookmark Pages
Pages: Home Index All Pages