Form Dirty Check
Form Dirty Check is a mechanism that detects changes in a form’s input fields, helping ensure that users do not lose unsaved modifications. This is particularly useful for:
- Data validation before submission.
- Prompting users to save changes before navigating away.
How It Works
- A form is considered "dirty" when any of its input values (text, select, checkbox, etc.) change from the initial state.
- The Clear Form Dirty action resets the form, marking it as pristine again.
Guarding Against Unsaved Changes
If Dirty Check Guard is set to "Yes" in the interface or master layout metadata configuration, the system prompts users with a confirmation dialog before navigating away, preventing accidental data loss.
Follow the below steps to add the Form Dirty Check construct in an event flow:
- In the designer canvas of an Interface, Master Layout and Component event flow, drag and drop the Form Dirty Check construct into the flow.
- Double-click the construct to configure the properties as required and then click Save.
| Property | Description | Comments |
|---|---|---|
| Label | Labels help developers quickly understand each step in the logic flow without examining the details of the construct. | It is recommended to provide a simple precise label that can improve the readability. |
| Form Selection | Select ‘Whole Form’ or ‘Individual Groups’ from the list. | Whole Form: If the Whole form is selected, dirty check will be applied to the whole form. Individual Groups: If the Individual Groups are selected, a multi-select dropdown (Groups) will be appeared. |
| Groups | Allowing user to choose and check dirty for specific form group(s). | When individual groups are selected, only the form groups corresponding to the selected validation groups will undergo a dirty check. |
| Comment | Specify whether to comment this construct or not. Either Yes or No. | By default, it is set to No. If marked as Yes, the construct is treated as a commented expression and ignored in code generation. |
| Description | Provides details about the Form Dirty Check purpose and behaviour. | Helps in understanding Form Dirty Check construct. |
Note: An asterisk (*) denotes that the property is mandatory for adding the Form Dirty Check construct.
The success message displays upon successfully adding the construct.
Edge Paths
Double-click on the edge path to configure the properties required and then click save.
Edge related description
pristine: Returns true if the control has not been modified.
dirty: Returns true if the control has been modified.
| Property | Description | Comments |
|---|---|---|
| Path | Select the edge path. Choose one of below: dirty pristine after | dirty: It is used to configure the logic for detecting modifications in the whole form or individual groups. pristine: It is used to configure the logic when whole form or individual groups are not modified. after: It is used to specify the logic run after the ‘Form Dirty Check’ construct. |