Hi,
Our customer would like to handle the closing of the browser and call the server module.
So, they are currently using the code below.
-----
Evtroutine Handling(#sys_web.CloseQuery) Querystring(#QueryString)
Define_Com Class(#ServerModule.SAVE) Name(#SAVE)
#SAVE.ExecuteAsync( #AAA )
#QueryString := "Closing the page will end the LANSA session"
Endroutine
-----
But, in this case, the message specified with "#QueryString" is displayed at the prompt.
If we do not set a value for #QueryString, this event will not be handled.
We don't want this prompt to appear.
Is there a way to handle closing the browser and not displaying prompt?
Best regards,
Rieko Saitoh
LANSA japan
VL- Web : How to avoid prompting when handling closing a browser.
-
Rieko Saitoh
- Posts: 58
- Joined: Sat Apr 30, 2016 11:46 am
-
Tim McEntee
- Posts: 57
- Joined: Thu May 26, 2016 8:46 am
Re: VL- Web : How to avoid prompting when handling closing a browser.
Hi Rieko Saitoh
Turns out that this is easy. I set the query string to blank and the prompt is not shown.
This is in Chrome. I didn't test in other browsers. The window.onbeforeunload feature that this hooks into is browser specific, so you may get different results with different browsers.
Evtroutine Handling(#sys_web.CloseQuery) Querystring(#QueryString)
Define_Com Class(#ServerModule.SAVE) Name(#SAVE)
#SAVE.ExecuteAsync( #AAA )
#QueryString := ""
Endroutine
Tim
Turns out that this is easy. I set the query string to blank and the prompt is not shown.
This is in Chrome. I didn't test in other browsers. The window.onbeforeunload feature that this hooks into is browser specific, so you may get different results with different browsers.
Evtroutine Handling(#sys_web.CloseQuery) Querystring(#QueryString)
Define_Com Class(#ServerModule.SAVE) Name(#SAVE)
#SAVE.ExecuteAsync( #AAA )
#QueryString := ""
Endroutine
Tim