public/adaptive-form.js
The client-side Adaptive Form renderer.
It:
- Calls the Node.js
/api/adaptive-formendpoint. - Reads the
afModelDefinitionreturned by AEM Forms. - Traverses the form’s
:itemsand:itemsOrderstructure. - Detects panels and recursively renders their contents.
- Maps supported Adaptive Form field types to standard HTML controls.
- Uses properties from the AEM form model such as labels, names, visibility, enabled state, and drop-down values.
For example, an AEM field such as:
is dynamically rendered as an HTML email input.
The renderer currently supports:
- Panels
- Text inputs
- Email inputs
- Telephone inputs
- Date inputs
- Drop-down lists
The renderer does not contain knowledge of the specific fields in the Adaptive Form. Adding another supported field to the form in AEM allows the client to discover and render it without adding field-specific code.
Application Flow
The responsibilities of the JavaScript files can be summarized as:
server.js
|
+-- Application and Express configuration
|
v
routes/adaptive-form.js
|
+-- Retrieves the Adaptive Form definition from AEM
|
v
public/adaptive-form.js
|
+-- Converts the Adaptive Form JSON into HTML controls
|
v
Headless Form UI
Was this content helpful?
Announcements
Get hands-on with agentic AI.
Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.
Find an eventAdobe Experience Manager Roadmap Webinar, Part 2 (Forms, Cloud & Managed Services) - Americas & EMEA
Preview the AEM Forms, Cloud, and Managed Services roadmap. Ask the team live.
Adobe Experience Manager Roadmap Webinar, Part 2 (Forms, Cloud & Managed Services) - Americas & APAC
Preview the AEM Forms, Cloud, and Managed Services roadmap. Ask the team live.