Close Page Activity Not Working After Browser Refresh in Mendix

0
Question: Hi Community, I’m facing an issue with the Close Page activity in a microflow used for the Cancel button on a detailed page. Scenario: When I open any record and click the Cancel button, the Close Page action works as expected, and the page closes without saving changes. However, if I refresh the browser manually and then try to cancel, the Cancel button becomes disabled or does not trigger the close action, even though the microflow is executed correctly (confirmed via debugger). What I’ve Checked: The microflow connected to the button is still triggered after the refresh. The flow logic is correct and the Close Page activity is reached. The issue only occurs after manually refreshing the browser. Question: Is this expected behavior in Mendix after a browser refresh? Could this be related to the object context being lost or detached after reload? Any best practices or workaround to make the Cancel button and Close Page action work reliably even after a browser refresh? Thanks in advance!
asked
2 answers
1

Hi Psuhpendra,

 

Close Page Action: The Close Page activity is an instruction that the Mendix server sends to the client (the user's browser). It tells the client: "close the currently open page and return to the previous page in the navigation stack."

 

When you press F5, the browser reloads everything. The Mendix client is re-initialized and loses its entire internal navigation history. The reloaded detail page now becomes the first and only page in the navigation stack from the Mendix client's perspective.

 

As a result, when the microflow runs and sends the Close Page command, the client has no "previous page" to go back to. Consequently, the action fails silently, or the button is disabled because the client understands the action cannot be performed.

 

The best solution is to use the Show Page action to direct the user to a specific page.

 

Let me know if you have any question.

Édrien Kauê

answered
0

Hey!

 

I have noticed this behavior in my application as well

But i believe that this only happens locally and should not be the case on other environments.

 

answered