Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Check if Browser is closed
Check if Browser is closed [message #1073761] Thu, 25 July 2013 12:56 Go to next message
Stefan M is currently offline Stefan MFriend
Messages: 29
Registered: September 2012
Junior Member
Hi,

Since RAP 2.1. the client sends a notification to the server to shut the session down:
{"head":{"rwt_shutdown":true,"requestCounter":7},"operations":[]}
This is a very nice feature, but in our case we would also need to know if the session was terminated this way:
When our users open for example a person record and edit it but do not save, then close the application via the x-button, our Workbench-pre shutdown listener fires and closes all open windows. If unsaved changes are present it displays a message if the users wants to save or discard, after that the person gets unlocked in the database. The users chooses and then the normal shutdown-procedure continues.
But when the user just closes the browser the pre-shutdown listener also fire and the message is displayed, but the client is not connected any more. So the thread waits and waits.
If we could determine that the browser was closed we could discard the changes automatically and unlock the person in the database.
We looked at the RAP-source code but did not find any reference to the last received message, also RWT.getRequest.getInputStream() does not work in this case.
Is there any way to do this?

Thanks in advance
Re: Check if Browser is closed [message #1074226 is a reply to message #1073761] Fri, 26 July 2013 10:12 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1295
Registered: July 2009
Senior Member

Hi Stefan,

there is currently no way to distinguish whether a UISession has been
terminated by a browser close or a session timeout.

However, the UIThread being locked up in preShutdown sounds like a bug
in our workbench implementation, this case should be handled by the
framework.

Could you please open a bug report? We can then also use this bug to
search for a workaround for your application.

Thanks,
Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:disable SystemMessage-DisplayOverlay
Next Topic:Editable TableViewer with background color
Goto Forum:
  


Current Time: Thu Dec 18 13:47:42 GMT 2014

Powered by FUDForum. Page generated in 0.02199 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software