XFA Specification
Chapter 6, Template Features for Designing Forms with Repeating Sections
Forms with Repeated Fields or Subforms
201
Data DOM
Members
When this data is loaded into the Data DOM, the Data DOM has the
structure shown at left. The two Member data groups can be individually
referenced in SOM expressions as
Member[0]
and
Member[1]
. They are
stored in the Data DOM in the same order that they occur in the data
document. (“Scripting
Object Model” on page 81)
Date
“01/01/04”
Member[0]
First
“John”
Last
“Brown”
Member[1]
First
“Betty”
Last
“White”
Data DOM after loading
data with repeated
Member data group
Repeated Subform Declarations
A static template can express repeated subforms in two ways. The simpler way, conceptually, is repeated
declarations within the template packet. For example, the template for the garden club membership
roster could be expressed as follows.
Example 6.13 Membership roster template using repeated subform declarations
<template ...>
<subform name="Members">
<field name="Date" ...>...</field>
<subform name="Member">
<field name="First" ...>...</field>
<field name="Last" ...>...</field>
</subform>
<subform name="Member">
<field name="First" ...>...</field>
<field name="Last" ...>...</field>
</subform>
<subform name="Member">
<field name="First" ...>...</field>
<field name="Last" ...>...</field>
</subform>
</subform>
</template>
Note that the template has three
Member
subforms and therefore has room for at most three lines of
member information. If the data contains more than three
Member
data groups, only the first three will be
bound into the form. Additional data groups will be loaded into the Data DOM but, because they are not
Home Index Bookmark Pages
Pages: Home Index All Pages