Confirm Dialog before window close

Hi,
I’ve been trying for hours to get some kind of “Do you want to save” Dialog presented before the browser is closed.
The confirmatiodialog itself is no problem.
What I want is:
If the user closes the whole browser, or just the tab of my main window, I want a dialog to appear which asks whether eventual changes should be saved.
My problem is, that I cant prevent the window from closing. I tried to remove the close button with css, but this only removes the “X” for one particular tab and not the close button of browser.
Currently I am using a new window for the confirm dialog which is added by “.addWindow(…)” to my main Window.
To prevent the mainwindow from closing before the user has made his “save or not” decision, I tried to override the “.close()” function of my mainwindow. I just left out the “super.close()”, hoping that the window would stay open.
Unfortunately, it closed.

Is there any way to prevent the whole browser from closing until the user has made his decision?
If not, is it possible using something like Mozilla Prism (can you recommend similar frameworks which can easily be used with vaadin?)

Thanks in advance.

Best regards,

Steve

try this…
https://vaadin.com/directory#addon/confirmdialog

Looks like I’m replying to an old thread, but here goes anyway:

Not exactly what you wanted, but maybe you could just remind the user that he has unsaved changes when he is leaving/closing the page using the OnBeforeUnload event? Example: http://www.4guysfromrolla.com/demos/OnBeforeUnloadDemo2.htm That way he can press “cancel”, go back and save the changes himself if needed.

In Vaadin/GWT you should be able to implement this by creating a widget that adds a Window Closing handler http://google-web-toolkit.googlecode.com/svn/javadoc/2.3/com/google/gwt/user/client/Window.html#addWindowClosingHandler(com.google.gwt.user.client.Window.ClosingHandler)

An another solution is proposed in the thread
vaadin.com/forum/-/message_boards/view_message/83206
.