Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [rap-dev] Are there any ways to be notified of user event: close a browser tab.

Hi,

please see my comments below.
BTW, please use the newsgroups for further usage related postings
http://www.eclipse.org/newsportal/thread.php?group=eclipse.technology.rap

HTH
R??diger

lishuqiang wrote:
Hi all,
I am new to RAP and I got a question, Are there any way to be notified of user event on closing a browser tab.
There is no reliable way to get notified when the browser window/tab is closed.

I am working on  a RAP platform (version: 2009.3.19)
I want to be notified when user close a tab or the entire browser window.
I have tried these:

    *  Add a SessionStoreListener and implement its beforeDestroy method
      to the ISessionStore instance returned from RWT;
This is the recommended way if you want to be notified when a session is invalidated.
Note that a session will be invalidated
a) on session timeout (see
b) before it is restarted (e.g. the user hits F5)

* Add a WorkbenchWindowListener and implement its windowClosed method to the current workbenh;
    *  Add a WorkbenchListener and implement its preShutdown  method to
      the active workbench window.

None of them functions properly (Firefox 3.0.9)
But the beforeDestroy and preShutdown will be invoked when I come back to the link later. By the way , I shifted from M5 to the current version. On M5 beforeDestroy and preShutdown are invoked on closing the tab (not on revisit the link). It seems the two versions behave differently without any changes on source code.
I am not aware of a malfunction of these mechanisms. Feel free to file a bugzilla if you can reproduce the problem.

I guess that there will be other way out. I might try M7 when it is available.
Thanks in advance.




------------------------------------------------------------------------
?????????????????????????????????? <http://email.163.com>


------------------------------------------------------------------------

_______________________________________________
rap-dev mailing list
rap-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/rap-dev


Back to the top