Show an error if user tries to navigate from current page to any of the pages in the navigation menu including home

0
Hi All,   I want to show error message when user attempts to navigate from the current page to any in the navigation menu including home page without saving the data. Right now, I could use Boolean flags to help with the data saved/unsaved part of the problem but to be able to use them to check in the current object if the flags are true or not, I'm facing issues.  Issue #1 is in navigation menu, if we have a on click microflow action, parameter is not allowed in that so I'm not able to get the context object.  Issue #2 is even in retrieve action in microflow, current object is not available to use in so I'm unable to get the context object.   I saw a community widget that could help with this but that is not compatible with our application version, which is 9.24.4, widget support is for versions from 9.24.5. But I just wanted to know if there is any out-of-the-box solution for this.   Thanks, Sridevi
asked
2 answers
1

If you go to the widget Exit Intent (Wait Don't Go): https://marketplace.mendix.com/link/component/21721 and press the tab releases you see an older version with the comment that it even works with Mx8. Have you tried that one?

Regards,

Ronald

[EDIT]

And on a side note you might want to upgrade to a later version because of security issues. See release notes: https://docs.mendix.com/releasenotes/studio-pro/9.24/#92431

answered
0

Hello Sridevi,

 

In the community commons module there is a java action called objectHasChanged.

 

You can use this action to validate if the object value(s) in memory correspond with the ones from the database before opening another page.  If it has changed you can offer a popup with the notification you want and with the actions to either save or discard changes. With proper use of subflows you can create re-usable solution.

 

This solution might cost a bit more work to create but has less dependencies (community commons).

answered