Adding proper support for the confirmation dialog before closing a window or navigating away from the current page (i.e. beforeunload event) was attempted, but, unfortunately, browsers currently don't offer the necessary behaviour and hooks to support this properly in ICEfaces. The intention was to be able to react to the user's answer to the confirmation dialog before leaving a page. If they decide to stay on the page, the page's state shouldn't change, and if they decide to leave the page, the window dispose and tear down methods should be executed before the page is closed. While it's possible to support the first case, when the user stays on the page, it's not possible to fully support the second case, when the user leaves the page. This is in part because it's not possible to execute most javascript calls on the page after the user answers that they want to leave the page. Certain javascript functions are allowed to execute by the browsers, but it's not possible to execute all the code that's necessary to gracefully leave the page in this use case. While it's still possible to execute some of this code, there's no simple and reliable way to do it.
For reference, this is the code necessary to display the confirmation dialog to leave a page, bypassing the listeners to dispose of the view: