Home » Eclipse Projects » Remote Application Platform (RAP) » observe when user hit the browser refresh button
|
Re: observe when user hit the browser refresh button [message #117640 is a reply to message #117627] |
Tue, 06 January 2009 14:47 |
Eclipse User |
|
|
|
Originally posted by: benjamin.wolff.web.de
Hi Roland,
the problem is that there doesn't seem to be a reliable way to notice when the user leaves the page or closes the browser.
the method postWindowClose() is not called in this case. this is a problem for me, because i have to rely on the tomcat
session timeout to close the ressources (database etc.). the postWindowClose() is only called when the User uses a logout or
exit action. it is possible to specify a exitconfirmation when the user leaves the page or closes the browser, but this is realised
with a simple javascript function that pops up a dialog with a string. if there is, or will be, any way to bind a method call, upon leaving the
browser, via javascript i'd really love to hear it :).
if the session is destroyed upon refreshing the page you could hook an listener on the session and use the method beforeDestroy() to cancel running
jobs...
greetings,
ben
Roland Siebert schrieb:
> Hi,
>
> I have a little problem.
> I'm using a background thread to update some data from a server every 20
> seconds.
>
> The user can start and stop the update manually.
> But when this update is running and the user is pressing the refresh
> button of the browser, I get an SWTException: Invalid thread access.
>
> Is there any possibility to observe when user hit the browser refresh
> button, so that I can first stop this update???
>
> Roland
|
|
|
Re: observe when user hit the browser refresh button [message #117650 is a reply to message #117640] |
Tue, 06 January 2009 16:08 |
rollo Messages: 117 Registered: July 2009 |
Senior Member |
|
|
Hmm,
I tried out the method postWindowClose() and it will be called when I
hit the refresh button.
Roland
Ben W. schrieb:
> Hi Roland,
>
> the problem is that there doesn't seem to be a reliable way to notice
> when the user leaves the page or closes the browser.
> the method postWindowClose() is not called in this case. this is a
> problem for me, because i have to rely on the tomcat
> session timeout to close the ressources (database etc.). the
> postWindowClose() is only called when the User uses a logout or
> exit action. it is possible to specify a exitconfirmation when the user
> leaves the page or closes the browser, but this is realised
> with a simple javascript function that pops up a dialog with a string.
> if there is, or will be, any way to bind a method call, upon leaving the
> browser, via javascript i'd really love to hear it :).
>
> if the session is destroyed upon refreshing the page you could hook an
> listener on the session and use the method beforeDestroy() to cancel
> running
> jobs...
>
> greetings,
> ben
|
|
|
Re: observe when user hit the browser refresh button [message #117661 is a reply to message #117650] |
Tue, 06 January 2009 16:50 |
Eclipse User |
|
|
|
Originally posted by: benjamin.wolff.web.de
hi,
could you please check if the method is also called when closing the browser (X) or leaving the url?
greetings,
ben
Roland Siebert schrieb:
> Hmm,
>
> I tried out the method postWindowClose() and it will be called when I
> hit the refresh button.
>
> Roland
>
> Ben W. schrieb:
>> Hi Roland,
>>
>> the problem is that there doesn't seem to be a reliable way to notice
>> when the user leaves the page or closes the browser.
>> the method postWindowClose() is not called in this case. this is a
>> problem for me, because i have to rely on the tomcat
>> session timeout to close the ressources (database etc.). the
>> postWindowClose() is only called when the User uses a logout or
>> exit action. it is possible to specify a exitconfirmation when the
>> user leaves the page or closes the browser, but this is realised
>> with a simple javascript function that pops up a dialog with a string.
>> if there is, or will be, any way to bind a method call, upon leaving the
>> browser, via javascript i'd really love to hear it :).
>>
>> if the session is destroyed upon refreshing the page you could hook an
>> listener on the session and use the method beforeDestroy() to cancel
>> running
>> jobs...
>>
>> greetings,
>> ben
|
|
|
Re: observe when user hit the browser refresh button [message #117777 is a reply to message #117661] |
Wed, 07 January 2009 10:44 |
rollo Messages: 117 Registered: July 2009 |
Senior Member |
|
|
Hi,
yes, it will be called when you reload the page, close the browser,
close the tab and also when you type another url.
Roland
Ben W. schrieb:
> hi,
>
> could you please check if the method is also called when closing the
> browser (X) or leaving the url?
>
> greetings,
> ben
>
>
> Roland Siebert schrieb:
>> Hmm,
>>
>> I tried out the method postWindowClose() and it will be called when I
>> hit the refresh button.
>>
>> Roland
>>
>> Ben W. schrieb:
>>> Hi Roland,
>>>
>>> the problem is that there doesn't seem to be a reliable way to notice
>>> when the user leaves the page or closes the browser.
>>> the method postWindowClose() is not called in this case. this is a
>>> problem for me, because i have to rely on the tomcat
>>> session timeout to close the ressources (database etc.). the
>>> postWindowClose() is only called when the User uses a logout or
>>> exit action. it is possible to specify a exitconfirmation when the
>>> user leaves the page or closes the browser, but this is realised
>>> with a simple javascript function that pops up a dialog with a
>>> string. if there is, or will be, any way to bind a method call, upon
>>> leaving the
>>> browser, via javascript i'd really love to hear it :).
>>>
>>> if the session is destroyed upon refreshing the page you could hook
>>> an listener on the session and use the method beforeDestroy() to
>>> cancel running
>>> jobs...
>>>
>>> greetings,
>>> ben
|
|
| |
Re: observe when user hit the browser refresh button [message #117800 is a reply to message #117788] |
Wed, 07 January 2009 12:21 |
Eclipse User |
|
|
|
Originally posted by: benjamin.wolff.web.de
Hi,
i've tested this by launching the app from eclipse and launching deployed on a tomcat.
using firefox, it seems that the mechanism works fine now, the method is called when leaving
the url or closing the browser, almost always. With Internet Explorer it doesn't seem to work
very reliable but the method is also called many times.
this is a very pleasant change because this didn't work so reliably in the past which gave
me some problems.
very nice!!!
greetings
ben
stefan.hansel@tolina.de schrieb:
>>> yes, it will be called when you reload the page, close the browser,
>>> close the tab and also when you type another url.
>
> Is this a new feature ? Some time ago exactly that didn't work (at least
> not when closing the browser) and I can't remember having read something
> about this in the release notes ?
> That would be really great indeed, if that worked now !
|
|
|
Re: observe when user hit the browser refresh button [message #117811 is a reply to message #117800] |
Wed, 07 January 2009 12:41 |
Rüdiger Herrmann Messages: 581 Registered: July 2009 |
Senior Member |
|
|
Just a note of clarification, there are reliable mechanisms to
observe *whenever* a session terminates (e.g. ISessionStoreListener,
postWindowClose). However, closing the browser window or tab does
*not* terminate the session. The session is terminated after the
session-timeout has elapsed without any request being sent to the
session.
In RAP, this behavior hasn't changed since ever.
HTH
Rüdiger
Ben W. wrote:
> Hi,
>
>
> i've tested this by launching the app from eclipse and launching
> deployed on a tomcat.
> using firefox, it seems that the mechanism works fine now, the method is
> called when leaving
> the url or closing the browser, almost always. With Internet Explorer it
> doesn't seem to work
> very reliable but the method is also called many times.
>
> this is a very pleasant change because this didn't work so reliably in
> the past which gave
> me some problems.
>
> very nice!!!
>
>
> greetings
> ben
>
>
>
> stefan.hansel@tolina.de schrieb:
>>>> yes, it will be called when you reload the page, close the browser,
>>>> close the tab and also when you type another url.
>>
>> Is this a new feature ? Some time ago exactly that didn't work (at
>> least not when closing the browser) and I can't remember having read
>> something about this in the release notes ?
>> That would be really great indeed, if that worked now !
|
|
|
Re: observe when user hit the browser refresh button [message #117822 is a reply to message #117811] |
Wed, 07 January 2009 13:01 |
Eclipse User |
|
|
|
Originally posted by: benjamin.wolff.web.de
Hi Rüdiger,
i use the postWindowClose() method to close the session immediately (set the timeout on 1 second programmatically), the
ISessionStoreListener always worked fine, that's right.
Greetings,
ben
Rüdiger Herrmann schrieb:
> Just a note of clarification, there are reliable mechanisms to observe
> *whenever* a session terminates (e.g. ISessionStoreListener,
> postWindowClose). However, closing the browser window or tab does *not*
> terminate the session. The session is terminated after the
> session-timeout has elapsed without any request being sent to the session.
> In RAP, this behavior hasn't changed since ever.
>
> HTH
> Rüdiger
>
>
> Ben W. wrote:
>> Hi,
>>
>>
>> i've tested this by launching the app from eclipse and launching
>> deployed on a tomcat.
>> using firefox, it seems that the mechanism works fine now, the method
>> is called when leaving
>> the url or closing the browser, almost always. With Internet Explorer
>> it doesn't seem to work
>> very reliable but the method is also called many times.
>>
>> this is a very pleasant change because this didn't work so reliably in
>> the past which gave
>> me some problems.
>>
>> very nice!!!
>>
>>
>> greetings
>> ben
>>
>>
>>
>> stefan.hansel@tolina.de schrieb:
>>>>> yes, it will be called when you reload the page, close the browser,
>>>>> close the tab and also when you type another url.
>>>
>>> Is this a new feature ? Some time ago exactly that didn't work (at
>>> least not when closing the browser) and I can't remember having read
>>> something about this in the release notes ?
>>> That would be really great indeed, if that worked now !
|
|
|
Re: observe when user hit the browser refresh button [message #117846 is a reply to message #117822] |
Wed, 07 January 2009 14:11 |
Rüdiger Herrmann Messages: 581 Registered: July 2009 |
Senior Member |
|
|
Ben,
sorry, my previous post was misleading. Of course the
SessionStoreListener is the only way to stay informed about the end
of a session.
Cheers,
Rüdiger
Ben W. wrote:
> Hi Rüdiger,
>
>
> i use the postWindowClose() method to close the session immediately (set
> the timeout on 1 second programmatically), the
> ISessionStoreListener always worked fine, that's right.
>
>
> Greetings,
> ben
>
>
>
> Rüdiger Herrmann schrieb:
>> Just a note of clarification, there are reliable mechanisms to observe
>> *whenever* a session terminates (e.g. ISessionStoreListener,
>> postWindowClose). However, closing the browser window or tab does
>> *not* terminate the session. The session is terminated after the
>> session-timeout has elapsed without any request being sent to the
>> session.
>> In RAP, this behavior hasn't changed since ever.
>>
>> HTH
>> Rüdiger
>>
>>
>> Ben W. wrote:
>>> Hi,
>>>
>>>
>>> i've tested this by launching the app from eclipse and launching
>>> deployed on a tomcat.
>>> using firefox, it seems that the mechanism works fine now, the method
>>> is called when leaving
>>> the url or closing the browser, almost always. With Internet Explorer
>>> it doesn't seem to work
>>> very reliable but the method is also called many times.
>>>
>>> this is a very pleasant change because this didn't work so reliably
>>> in the past which gave
>>> me some problems.
>>>
>>> very nice!!!
>>>
>>>
>>> greetings
>>> ben
>>>
>>>
>>>
>>> stefan.hansel@tolina.de schrieb:
>>>>>> yes, it will be called when you reload the page, close the
>>>>>> browser, close the tab and also when you type another url.
>>>>
>>>> Is this a new feature ? Some time ago exactly that didn't work (at
>>>> least not when closing the browser) and I can't remember having read
>>>> something about this in the release notes ?
>>>> That would be really great indeed, if that worked now !
|
|
|
Goto Forum:
Current Time: Fri Dec 27 02:37:41 GMT 2024
Powered by FUDForum. Page generated in 0.04327 seconds
|