Composite multifield dialog values not restoring on reopen

This article explains how to resolve the issue where only the primary field value in a composite multifield dialog of an AEM Forms custom component is restored on dialog reopen, while other fields remain empty despite correct repository persistence.

Description description

Environment

Adobe Experience Manager (AEM) Forms as a Cloud Service (all versions)

Issue/Symptoms

When using a custom Adaptive Form component dialog configured with a composite multifield (multiple fields per multifield item or row), only the value of the primary field (the one whose name matches the multifield container’s name) is restored when the dialog is reopened. All other fields in the same multifield item appear empty, even though their values are correctly saved in the repository. This issue doesn’t occur for single-field multifields.

Cause

Composite multifield values stored as arrays at the property level don’t provide the structure required for the dialog framework to restore all fields on reopen. Child node persistence enables native save and reload behavior for all fields in a composite multifield.

Resolution resolution

To fix the issue, follow these steps:

  1. Update the dialog XML configuration for your custom component:

    • Configure the composite multifield so that each multifield entry is persisted as a child node under the component node in the repository.
    • Ensure each field within the multifield item has a unique name and is defined within the child node structure.
  2. Adjust your component logic as needed:

    • If your component exports data as JSON (for example, for SPA consumption), implement or update a custom Sling Model and exporter to serialize the child node structure as required.
  3. Separate authoring and export concerns:

    • Limit any custom JavaScript to the dialog authoring experience.
    • Use backend logic for data export to model.json or similar endpoints.
  4. Save values in the dialog and verify:

    • Author values for all fields in the composite multifield, save, and reopen the dialog. All fields are restored with their previously entered values.
recommendation-more-help
experience-cloud-kcs-help-kbarticles