Extend a Fragment in a Dynamic Container

If your dependency contains a dynamic container that uses fragments, for example to format fields, add UI components in a section, or to add functionality, you can customize the fragment's contents that the developer has made accessible to extensions.

Note:

When you extend a fragment in a dependency, the changes you make will affect every place that fragment is used in your extension.

To extend a fragment in a container:

  1. With your page open in the Page Designer, select the fragment on the canvas or in the page's Properties pane.

    If the page has any accessible fragments, they're listed in the Components tab in the page's Properties pane. In the following image, the fragment name is the only extendable fragment in the dynamic container:



  2. Click Configure in the Properties pane to open the fragment in the Fragment Designer.

    The Properties pane displays a list of the extendable items in the fragment. You can click individual items to open them in the fragment's editor.



  3. After the fragment is open in the Designer, you can customize the elements that the fragment's developer has made accessible.

    In the Fragment Designer, the extendable components and constants are listed in the fragment's Properties pane. In this example, though the fragment contains components, the developer hasn't made any of them accessible, so they aren't listed in the Properties pane. The only constants that the fragment developer has made accessible (requireName and requireSalary) are listed in the Constants tab in the Properties pane:



    When extending a fragment in the Fragment Designer, or any of the fragment's other editor tabs, a warning is displayed at the top of the editors to let you know you're now extending a fragment:



  4. Configure the fragment in the fragment's editor tabs.

    Once the fragment is open, you can configure it as needed. Some elements in the fragment will be accessible, as you can see in the image below of the fragment's Variables tab. The fragment developer has made two constants in the fragment extendable—extensions can set the default value of each constant:



    Depending on the fragment, you might also want to use the other fragment editors to extend the fragment, for example, to add and configure variables and events, just as you would in a page. For example, in the fragment's Event Listeners tab, you can create an event listener for custom fragment events that the developer has made accessible. When creating the event listener, the accessible fragment events are listed in the Create Event Listener wizard. For more, see Work With Events and Event Listeners.