You
can create a fragment in a separate XDP file or in the current form
design. When you create the fragment in a separate file, you can
replace the selected objects with a reference to the fragment file.
If you do not replace the selection with a fragment reference, the
fragment is created, but the selection remains unchanged and is
not connected to the new fragment. Leaving the selection unchanged
saves steps when you need to create multiple, similar fragments.
Creating the fragment in the current file is useful when you
want to define multiple fragments in one file. Creating multiple
fragments in one file can make it easier to update multiple fragments,
particularly when the fragments are similar.
Fragments are identified by the fragment name. When you create
the fragment in a separate file, you can also specify the location
and the file name. The fragment name does not have to match the
file name.
The fragment name appears in the Fragment Library when you click
OK in the Create Fragment dialog box. When you create a fragment
in the current form design and save it as an XDP file, the fragment
name appears in the Fragment Library when you save the file.
When you create a fragment, you can either select an existing
subform or select one or more objects. If you select objects that
are not in a subform, the objects are wrapped in a subform when
the fragment is created.
Note:
After you create a fragment by selecting existing
objects, update script references in the fragment to reflect that
the objects are wrapped in a new subform.
You can use the menu to create a fragment, or you can drag the
selected objects into the Fragment Library. When you create a fragment
by dragging the selection into the Fragment Library, the option
for creating the fragment in the current file is unavailable.
Save fragment source files as XDP files. If you save a fragment
source file as a PDF file, the fragments cannot be referenced in
other forms.
When you
create a fragment in a AEM forms application and check it in, it
is saved in the repository and appears in the Applications view in
Workbench.
Create script fragments from script objects instead of subforms,
and create them from the Hierarchy palette.
For more
information about creating and inserting script fragments, see
Using
Script Fragments
.
Inserting fragment references
You
can use fragments to reuse content in multiple forms. When creating
a form design, insert a reference to an existing fragment and the
fragment appears in the form design.
After you insert a fragment reference, you can reposition it
in the form design.
If you are
using Designer with Workbench, you can insert a reference to a fragment
that is outside the root application folder or is not in a Workbench
application. However, you must copy the fragment and the files it
references into the current application. The files are copied into
the same folder as the current form, and the references to the files
are updated.
To preview the fragments in the Fragment Library palette, select Show Preview Pane from the palette menu.
To insert a fragment from the Fragment Library palette
Do one of the following actions:
-
Drag the
fragment onto the form design.
Note:
You cannot drag a fragment from the Fragment Library palette onto a subform that is a child of a SubformSet. The cursor changes and Designer displays a warning icon (a circle with a diagonal line) to indicate that this operation is illegal.
-
Double-click the fragment.
To insert a fragment from the Insert menu
-
Select
Insert > Fragment.
-
Navigate to the file that contains the fragment.
-
Select the file.
-
If the file contains more than one fragment, select the fragment.
-
Click OK. The fragment appears in the center of the visible
page.