Create an Adaptive Form Fragment
You can create an Adaptive Form Fragment from scratch or save a panel in an existing Adaptive Form as fragment. To create a form fragment:
-
Log in to your AEM Forms instance at https://[hostname]:[port]/aem/forms.html.
-
Click Create > Adaptive Form Fragment.
-
Specify title, name, description, and tags for the fragment. Ensure that you specify a unique name for the fragment. If another fragment exists with the same name, the fragment fails to create.
-
Select a form template. You can create a form fragment for Core Components based Adaptive Forms or Foundation Components based Adaptive Forms. To create form fragment for Core Components based forms, select a Core Components based template.
When you create form fragment for Core Components based forms, use the Select Form Theme option to select a Core Components based theme.
-
Click to open the Form Model tab, and from the Select From drop-down menu, select one of the following models for the fragment:
-
None: Specifies to create the fragment from scratch without using any form model.
NOTE
In Adaptive Forms, you can use single form fragment (based on Core Components) multiple times. It supports both none-based and schema-based form fragments. -
Schema: Specifies to create the fragment using an XML or JSON schema uploaded to AEM Forms. You can upload or select from the available XML or JSON schemas as the form model for the fragment. When you select an XML schema, you can also create an Adaptive Form fragment by selecting a complexType present in the selected schema from the XML Schema Complex Type drop-down box. When you select a JSON schema, you can also create an Adaptive Form fragment by selecting a schema definition present in the selected schema from the JSON Schema Definitions drop-down box.
-
Form Data Model: Specifies to create the fragment using a form data model (FDM). You can create an Adaptive Form fragment based on only one data model object in a form data model (FDM). Expand Form Data Model (FDM) Definitions drop-down. It lists all data model objects in the specified form data model(FDM). Select a data model object from the list.
-
-
Click Create and then click Open to open the fragment, with a default template, in edit mode. In edit mode, you can add any Adaptive Form component to the fragment.
Once the Adaptive Form fragment based on a schema or form data model (FDM) is created, form data model (FDM) or schema elements appear in the Data Sources tab of the Content browser in Adaptive Form editor. You can drag-and-drop form-model elements onto the fragment. The added form-model elements are converted to form components while retaining the original properties from the associated schema.
Add a fragment to an Adaptive Form
To add an Adaptive Form fragment to an Adaptive Form:
-
Open the Adaptive Form in edit mode.
-
Add the Adaptive Form Fragment component to the form.
-
Open the Configuration dialog of Adaptive Form Fragment component.
-
Select the Fragment reference in the Basic tab. All the Adaptive Forms fragments available for your form, depending on the model of the form, appear.
-
Select an Adaptive Form fragment onto the Adaptive Form Fragment component on your Adaptive Form.
The Adaptive Form fragment is added by reference to the Adaptive Form and remains in synchronized with the standalone Adaptive Form fragment. This implies that any modifications made to the Adaptive Form fragment are mirrored across all instances where the fragment is incorporated within Adaptive Forms.
Using fragments within fragments
You can create nested Adaptive Form fragments, which means you can add a fragment in another fragment, and can have nested fragment structure.
Using a form fragment multiple times in an Adaptive Form
You can use a none-based and schema-based form fragment multiple times in an Adaptive Form to save data uniquely for each form fragments 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.
Manage fragments
You can perform several operations on Adaptive Form fragments using the AEM Forms UI.
-
Go to
https://[hostname]/aem/forms.html
. -
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.