How to restrict page closing until user clicks Save or Cancel in Mendix?
0
Hi all, In my Mendix application, I want to prevent users from leaving or closing a page (either by navigation or the close button) until they click Save or Cancel. How can I implement this behavior effectively?Is there a way to achieve it using a nanoflow, a page event widget, or conditional logic? Any suggestions or best practices would be appreciated.
asked
Sachin Ughade
1 answers
0
Hi sachin,
Disable default navigation buttons (e.g., close button, breadcrumbs, back button).
Add your own “Back” or “Close” button with a Nanoflow that:
Checks if data is changed.
If yes → Show confirmation (“Do you want to discard changes?”)
If confirmed → Roll back changes and close.
If no → Do nothing.
This gives full control and avoids unexpected navigation.