Perspective Refresh Behavior

I am having an issue where a view is not un-mounting properly (I think)

On my main page view I have a flex repeater with buttons that contain different data. When I click on the button, a script runs that opens a view and passes a parameter called "ID" into the view. There is a script running on the "onStartup" event handler for that view that runs a named query and gives back information on the "ID" passed into the view.

The issue I'm experiencing is when the browser is refreshed. If you're on the sub view and refresh, the browser returns to the main view (which is fine), however, when a different button with different data is clicked, the same data that was present before the refresh still persists.

I set up some loggers and found out that "onShutdown" does not trigger when the page is refreshed on a view so it seems like the view isn't clearing the data or unmounting.

Is this the inteded behavior? Is there way for that view to unmount or clear data up on refresh?

A Refresh of the browser results in the View lifecycle being hijacked. An onShutdown Event only occurs when the Session itself is driving the lifecycle (startup/shutdown) of Views. If you had instead navigated away from the View, or - for example - if the View was a Popup which was opened and then closed, then the onShutdown Event would be properly executed.

As far as the Session is concerned, the refresh resulted in the "secondary" View here being orphaned. It should eventually be removed from the Session's registry but even at that point I don't know that its onShutdown Event would be executed.