How to Implement an Unsaved Changes Warning on Cancel Button in Mendix?

0
Hi everyone, I’m working on a functionality to improve usability in an application. The goal is to display a warning to users if they attempt to cancel out of a detail screen with unsaved changes. This ensures users are informed and prevents accidental data loss. Key Requirements: Benefits: The feature is aimed at informing editors or infrastructure users about unsaved changes when cancelling, thus avoiding accidental data loss. Functionality: If unsaved changes exist and the user clicks "Cancel," a warning message should be displayed. The warning should give the user two options: "Cancel" (stay on the screen) or "Confirm" (proceed with cancelling). My Question: What’s the best way to implement this functionality in Mendix? Are there any built-in features, best practices, or custom widgets that can help detect unsaved changes and display a warning popup before cancelling? Any examples, suggestions, or tips would be greatly appreciated! Thanks in advance for your help
asked
1 answers
0

Hi Pushpendra Nayak,

     To implement logic to check the unsaved changes, Add Boolean attribute as IsSaved in your entity, Once the user clicks cancel check the boolean IsSaved is true, if true means continue the flow else if the boolean value is false add warning pop up as not saved and ask for a confirmation to proceed or not. And Finally change the IsSaved to true in Save flow.

answered