[Logo] OLD FORUM - Use new one: https://www.CaptainCasa.online/forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Web Page Reload (When User Press F5) Listener ???  XML
Forum Index -> Development
Author Message
vadingding

Power User
[Avatar]

Joined: 14/07/2017 13:26:37
Messages: 145
Offline

Hi Captain,

Does Captain Casa have a functionality that allows us to append or fire some code when the user reloads the page or presses F5???

I have a log out button that will invalidate the session and kill the database connection used by that session. Works like a charm...

But when the user presses F5 (Reload the page) I can't fire some code that will kill my database connection.

Can you give me some hint ???

Help would be much appreciated

Regards,
Vincent
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5555
Offline

...use component SESSIONCLOSER in your outmost page. This will cancel the server side session when the page disappears...

ONLY DEFINE IT ON THE OUTMOST PAGE! ;-) If an innter page is closed, this should not close the session...

On server side: Dispatcher.destroy() is called for the top-dispatcher instance (this is the one created via constructor without parameters).

Regards, Björn

PS: either by query parameter "?ccconfirmexit=true" or by using component CLIENTCONGIF-CONFIRMEXTI="true" you may tell the browser to start a popup asking the user "Do you really want to leave the page...?"

Björn Müller, CaptainCasa GmbH
vadingding

Power User
[Avatar]

Joined: 14/07/2017 13:26:37
Messages: 145
Offline

Thanks Captain! Will check
vadingding

Power User
[Avatar]

Joined: 14/07/2017 13:26:37
Messages: 145
Offline

Hi Captain,

I tried to over ride the Dispatcher.destroy() method but it doesnt work. Am I doing the right thing ???

Dispatcher class:

Code:
     @Override
     public void destroy() {
         super.destroy();
         Statusbar.outputAlert("YOW");
     }
 


The alert didnt show...

Regards,
Vincent
vadingding

Power User
[Avatar]

Joined: 14/07/2017 13:26:37
Messages: 145
Offline

It works like, user presses F5 + kill database connections + continue reload page.

So that... the connection is really closed to avoid too much connection problem.

vadingding

Power User
[Avatar]

Joined: 14/07/2017 13:26:37
Messages: 145
Offline

Got It!!!
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team