Save panel as a fragment

  1. Open an Adaptive Form that contains the panel you want to save as Adaptive Form Fragment.

  2. In the panel toolbar, click Save as Fragment. The Save As Fragment dialog opens.

    NOTE
    If the panel you are saving as fragment contains child panel, the resulting fragment will include them.
  3. In the Fragment Creation dialog, specify the following information:

    • Name: Name of the fragment. The default value is the element name of the panel. It is a mandatory field.

      NOTE
      Ensure that you specify a unique name for the fragment. If there already exists another fragment with the same name, the fragment fails to create.
    • Title: Title of the fragment. The default value is the title of the panel.

    • Description: Description of the fragment.

    • Tags: Tags metadata for the fragment.

    • Target Path: Repository path where the fragment is saved. If you do not specify a path, a node with the same name as that of the fragment gets created next to the node containing the Adaptive Form. The fragment is saved in this node.

    • Form Model: Depending on the form model for the Adaptive Form, this field displays the XML Schema, Form Template, or None. It is a non-editable field.

    • Fragment Model Root: Appears only in XSD-based Adaptive Forms. It specifies the root for the fragment model. You can choose / or the XSD complex type from the drop-down. You can reuse the fragment in another Adaptive Form only if you select the complex type as the fragment model root.
      If you choose / as the fragment model root, the complete XSD tree from the root is visible in the Adaptive Form Data Model tab. For a complex type fragment model root, only the descendants of the selected complex type are visible in the Adaptive Form Data Model tab.

    • XSD Ref: Appears only in XSD-based Adaptive Forms. It displays the location of the XML schema.

    • XDP Ref: Appears only in XDP-based Adaptive Forms. It displays the location of the XDP form template.

    save-fragment

    Save As Fragment dialog

  4. Click OK.

    The panel is saved at the specified or the default location in the repository. In the Adaptive Form, the panel is replaced by a snapshot of the fragment. As shown below, the General Information panel and its child panels, Personal Information and Address, are saved as a fragment.

    To edit the fragment, click Edit Asset in the panel toolbar. The fragment opens in a new tab or window in edit mode.

    Editing fragment

Working with fragments

Configure fragment appearance

Any fragment you insert in Adaptive Forms appears as a placeholder image. The placeholder displays titles of up to a maximum of ten child panels in the fragment. You can configure AEM Forms to show the complete fragment instead of the placeholder image.

Perform the following steps to show complete fragments in forms:

  1. Go to AEM web console configuration page at https:[host]:[port]/system/console/configMgr.

  2. Search and click Adaptive Form Configuration Service to open it in edit mode.

  3. Disable Enable Placeholder in place of Fragment checkbox to show complete fragments rather than the placeholder image.

Insert a fragment in an Adaptive Form

The Adaptive Form Fragments you create appear in the Adaptive Form Fragments tab of the AEM content finder. To insert an Adaptive Form Fragment in an Adaptive Form:

  1. Open the Adaptive Form, in edit mode, in which you want to insert an Adaptive Form Fragment.

  2. Click Assets assets-browser in the sidebar. In the assets browser, select Adaptive Form Fragments from the drop-down.

    You can also choose to display all Adaptive Form Fragments or filter based on their form model - Form Template, XML Schema, or Basic.

  3. Drag-and-drop an Adaptive Form Fragment onto the Adaptive Form.

    NOTE
    The Adaptive Form Fragment is not enabled for authoring from within the Adaptive Form. Moreover, you cannot use an XSD-based fragment in a JSON-based Adaptive Form and the opposite way.

The Adaptive Form Fragment is inserted by reference in the Adaptive Form and is synchronized with the standalone Adaptive Form Fragment. It means when you update the Adaptive Form Fragment, the changes reflect in all Adaptive Forms where the fragment is used.

Embed a fragment in Adaptive Form

You can choose to embed an Adaptive Form Fragment in an Adaptive Form by clicking Embed Asset: <fragmentName> button on the panel toolbar of the added fragment, as shown in the following example image.

Embed a form fragment in Adaptive Form

NOTE
The embedded fragment is no longer linked with the standalone fragment. You can edit the components in the embedded fragment from within the Adaptive Form.

Using fragments within fragments

You can create nested Adaptive Form Fragments, which means you can drag-drop a fragment in another fragment, and can have nested fragment structure.

Change fragments

You can replace or change an Adaptive Form Fragment by another fragment by using the Select Fragment asset property in the Edit component dialog for an Adaptive Form Fragment panel.

Using a form fragment multiple times in an Adaptive Form

You can use a schema-based form fragment multiple times in an Adaptive Form to save data uniquely for each form fragment fields. For example, you can use an address form fragment to collect address details for permanent, communication, and present living addresses in a loan application form.

using multiple fragment in adaptive form

NOTE
If you use none-based form fragments multiple times in an Adaptive form, data synchronization issue between the fields of the fragments occurs. You can use a core component based form fragment that is not tied to any form data model (FDM), multiple times in a form without experiencing data synchronization issues.

Auto mapping of fragments for data binding

When you create an Adaptive Form Fragment using an XFA form template or XSD complex type and drag-drop the fragment to an Adaptive Form, the XFA fragment or the XSD complex type is automatically replaced by the corresponding Adaptive Form Fragment whose fragment model root is mapped to the XFA fragment or XSD complex Type.

You can change the fragment asset and its bindings from the Edit component dialog.

NOTE
You can also drag-drop a bound Adaptive Form Fragment from Adaptive Form Fragment library in AEM content finder and provide the correct bind reference from the Edit component dialog of the Adaptive Form Fragment panel.

Manage fragments

You can perform several operations on Adaptive Form Fragments using the AEM Forms UI.

  1. Go to https://[hostname]:'port'/aem/forms.html.

  2. Click Select in the AEM Forms UI toolbar and select an Adaptive Form Fragment. The toolbar displays the following operations you can perform on the selected Adaptive Form Fragment.

OperationDescription
OpenOpens the selected Adaptive Form Fragment in edit mode.
View PropertiesOpens the Properties panel. From the Properties panel, you can view and edit properties, generate a preview, and upload a thumbnail image for the selected fragment. For more information, see Managing metadata.
CopyCopies the selected fragment. The Paste button appears in the toolbar.
DownloadDownloads the selected fragment.
PreviewProvides options to preview the fragment as an HTML or a custom preview by merging data from an XML file with the fragment.
Start Review/Manage ReviewAllows initiating and managing a review of the selected fragment.
Create DictionaryGenerates a dictionary for localizing the selected fragment.
Publish / UnpublishPublishes / unpublishes the selected fragment.
DeleteDeletes the selected fragment.