Creating and inserting fragments

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.

Note: You cannot create a fragment in a form created by importing a PDF file as artwork. For more information, see Importing PDF documents as artwork.

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 LiveCycle 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.

Create a fragment

  1. Select the objects to include in the fragment. You can select a fragment or multiple objects.

  2. Select Edit > Fragments > Create Fragment.

  3. (Optional) In the Description box, type a description of the fragment.

  4. Select a method for creating the fragment:

    • To define the fragment in a separate XDP file that is stored in the Fragment Library, select Create Fragment In Fragment Library.

      • In the stand-alone version of Designer, select the Fragment Library where you want to save the fragment file.

      • In Designer with Workbench, from the Fragment Libary list, select a LiveCycle application folder where you want to save the fragment file. You cannot select the root application folder.

      • (Optional) To use a different file name, in the File Name box, type the file name for the fragment.

      • To reference the new fragment in the current form design, select Replace Selection With Reference To New Form Fragment, and then click OK.

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.

Note: You cannot insert a fragment in a form that was created by importing a PDF file as artwork. (See Importing PDF documents as artwork.)
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

  1. Select Insert > Fragment.

  2. Navigate to the file that contains the fragment.

  3. Select the file.

  4. If the file contains more than one fragment, select the fragment.

  5. Click OK. The fragment appears in the center of the visible page.

// Ethnio survey code removed