XFA Specification
Chapter 8, Dynamic Forms
Layout for Dynamic Forms
284
Break to Empty pageArea or contentArea
A layout object may specify that it must start a new
pageArea
or
contentArea
without regard to the
current
pageArea
. This is done by specifying a
break
Before element having an attribute of
startNew
with a value of 1 and an attribute of
targetType
with a value of
pageArea
or
contentArea
. When the
layout processor encounters such an object it traverses to a new instance of the current
pageArea
or
contentArea
. For example, a template contains the following declarations:
<subform "W">
<pageSet name="A">
<pageArea name="B">
<contentArea name="C" … />
</pageArea>
</pageSet>
<subform name="X">
<breakBefore targetType="pageArea" startNew="1"/>
<field name="Y"/>
</subform>
</subform>
The Form DOM contains the following content:
[subform (X[0])]
[field (Y) = "data from first record"]
[subform (X[1])]
[field (Y) = "data from second record"]
At startup the layout processor descends into the first
contentArea
(C) of the first
pageArea
(B) of the
first
pageSet
(A). The first content it finds in the Form DOM is subform X[0], which asserts that it must be
placed into a new
pageArea
. This forces the layout processor to leave the current
pageArea
(even
though it is empty) and create a new one. Then the layout processor places the field and its text
“data
from first record
” into the instance of
contentArea
C. This small amount of text does not fill
contentArea
C. Now it comes to the second instance of subform X (X[1]). Again the startNew condition
forces it to start a new
pageArea
, the third instance of
pageArea
B. After this it adds a new instance of
contentArea
C and places subform X[1] and its field into the new instance of
contentArea
C. The
resulting Layout DOM is:
[root]
[pageset (A)]
[pageArea (B[0])]
[contentArea (C)]
[subform (W)]
[pageArea (B[1])]
[contentArea (C)]
[subform (W)]
[subform (X)]
[field Y = "data from the first record"]
[pageArea (B[2])]
[contentArea (C)]
[subform (W)]
[subform (X)]
[field Y = "data from the second record"]
If the above example (which has no boilerplate) is rendered and printed, the first page is blank.
The root subform (subform W in the above example) may assert
startNew
, but it has no practical effect
because the root subform always starts a new
pageArea
and
contentArea
.
Home Index Bookmark Pages
Pages: Home Index All Pages