The Dynamic Tabs Form component provides a vertical tab-based interface for organizing and managing related forms. This component allows users to navigate between different forms using vertical tabs, with each tab containing its own form or content. The component also supports form validation, saving data through a configured data source, and handling form submission events. It's particularly useful for complex forms that need to be divided into logical sections for better user experience.
DynamicVerticalTabComponent elements to create different form sections, each with its own content and validation state.createEntityDataSourceId - Specifies the data source ID for saving the collected form data. For example, setting this to "api/customers/create" would connect the form submission to the customer creation API endpoint, allowing all form data to be submitted at once.
createEntityHttpRequestParametersMap - Configures HTTP parameters for form submission requests. This object maps form data to the expected format for the API endpoint, with options to specify body, path, and query parameters for the request.
id - Specifies a unique identifier for the component used for programmatic access. For example, "customerRegistrationForm" enables targeted manipulation of this specific form in scripts or for automated testing.
dataTestId - Sets the testing hook ID for automated testing. For example, setting it to "customer-tabs-form" allows test scripts to reliably locate this component during test execution.
enableAsHotspot - Enables the component as a guided tour hotspot. When enabled, this component can be highlighted in guided tours to help users understand its functionality.
guidedTourHotSpotTitle - Sets the title for the guided tour hotspot with support for multiple languages. For example, {"en-US": "Customer Information Form", "fr-FR": "Formulaire d'information client"} ensures proper localization of the hotspot title.
guidedTourHotSpotDescription - Sets the description for the guided tour hotspot with language support. For example, {"en-US": "Fill in customer details across different tabs", "fr-FR": "Remplissez les détails du client à travers différents onglets"} provides localized guidance for users.
The DynamicTabsFormComponent exposes several actions that can be used in action configurations:
Save active tab as default - Saves the currently active tab as the default tab to display when the component loads. This is useful for preserving user navigation state between sessions.
Save connected forms using datasource connected to tabs form - Validates and submits all form data from all tabs to the configured data source. This action handles form validation across all tabs and manages the submission process.
Form is invalid - Checks if any form within the tabs is invalid. This action can be used to prevent navigation or submission when form data is incomplete or invalid.
Get element data - Retrieves the current data from all forms in the tabs. This is useful for getting a snapshot of form values without submitting them to the server.
Each tab in the tabs form can display its validation state visually:
The component collects data from all forms across all tabs and sends it to the configured data source endpoint. The data is structured based on the form definition and the createEntityHttpRequestParametersMap configuration.
Example request body:
{
"personalInfo": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com"
},
"addressInfo": {
"street": "123 Main St",
"city": "Boston",
"zipCode": "02108"
},
"preferences": {
"notifications": true,
"newsletter": false
}
}
The component expects a standard response indicating success or failure, and will handle error messages appropriately.