Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Check before application shutdown
Sun, Oct 25 2015 6:26 AMPermanent Link

Christian Kaufmann

I can use intialization/finalization do run some cleanup code and this works fine so far.

But would it be possible to have the onbeforeunload event in order to do some checks (e.g. for
unsaved data) and let the user confirm, that he wants to close the window?

cu Christian
Tue, Oct 27 2015 1:04 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Christian,

<< But would it be possible to have the onbeforeunload event in order to do some checks (e.g. for
unsaved data) and let the user confirm, that he wants to close the window? >>

I could probably look into adding something that allows for this, but displaying a modal dialog, etc. at that point would not be wise.  Your application should simply assume that it can go away at any time, and should work accordingly by doing auto-saving, etc. using a timer or some other method.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Oct 27 2015 4:36 PMPermanent Link

Christian Kaufmann

Tim Young [Elevate Software] wrote:

> I could probably look into adding something that allows for this, but displaying a modal dialog,
> etc. at that point would not be wise.  Your application should simply assume that it can go away
> at any time, and should work accordingly by doing auto-saving, etc. using a timer or some other
> method.

I think there will be only non visual code to check if the app can be closed and then the event
returns a message, that will be shown in a confirmation dialog of the browser. So no UI stuff there
anymore.

I have seen that in different applications, e.g. Outlook Web mail.

cu Christian
Tue, Oct 27 2015 5:35 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Christian,

<< I think there will be only non visual code to check if the app can be closed and then the event returns a message, that will be shown in a confirmation dialog of the browser. So no UI stuff there anymore. >>

What exactly is the confirmation dialog, if not UI ? Wink

But yes, I know what you're referring to (OnBeforeUnload event).  I'll have to check into this to see how consistent the behavior is across the various browsers.  I think there are some issues with Mobile Safari firing this event.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Oct 27 2015 5:46 PMPermanent Link

Rick

On 25/10/15 21:26, Christian Kaufmann wrote:
> I can use intialization/finalization do run some cleanup code and this works fine so far.
>
> But would it be possible to have the onbeforeunload event in order to do some checks (e.g. for
> unsaved data) and let the user confirm, that he wants to close the window?

You can try creating the event as described here:

http://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_general&msg=6644

--
Rick
Image