XFA Specification
Chapter 8, Dynamic Forms
Layout for Dynamic Forms
286
Inserting a Leader
A leader is an object which is laid down just before the before the object asserting breakBefore but after
the break mandate has been carried out, that is, after moving (if necessary) to the break target.
In the following template fragment a before break leader is used to lay down a heading. This is a common
use of before break headers.
<subform name="TermsAndConditions">
<breakBefore targetType="pageArea" leader="#TAndCTitle"/>
</subform>
If the
breakBefore
element supplies a script the trailer is only laid down if the script returns True.
A
breakBefore
leader may be combined with a bookend leader. The bookend leader is treated like part
of the object that is being laid down, hence after the break mandate has been carried out the
breakBefore
leader is laid down first, then the bookend leader, then the content of the object itself.
Break on Exit
A layout object may use its
breakAfter
property to force the layout processor to traverse to a different
pageArea
and/or
contentArea
after laying down the object. The semantics and use of this property
exactly mirror those of the
breakBefore
property which is discussed in
“Break on Entry” on page 283.
Despite this symmetry (or perhaps because of it) the handling of leaders and trailers may be confusing.
When
breakAfter
specifies a trailer the trailer is placed after the current layout object but before
moving to the break target. Conversely when
breakAfter
specifies a leader the leader is placed after
moving to the break target. The same effect is produced when an object is used as a leader for an after
break or as a trailer for the next object’s before break. For example, assume that the Form DOM contains:
[subform (root)]
[subform (TransactionDetails)]
[subform (TermsAndConditions)]
The following template fragment:
<subform name="TransactionDetails">
<breakAfter targetType="pageArea"
leader="#continued"/>
...
</subform>
<subform name="TermsAndConditions">
...
</subform>
produces the same result as:
<subform name="TransactionDetails">
...
</subform>
<subform name="TermsAndConditions">
<breakBefore targetType="pageArea"
trailer="#continued"/>
...
</subform>
A
breakAfter
trailer may be combined with a bookend trailer. The bookend trailer is treated like part of
the object that is being laid down, hence after the content of the object itself is laid down then the
bookend trailer is laid down, followed by the
breakAfter
trailer, and then the break mandate is carried
out.