Web Application - CloseQuery Event

Fired when the browser navigates away from the WebPage

Member of Web Application (PRIM_WEB.Application)

Parameters

NameTypeData TypeDescription
QueryString*BothStringText to be displayed in the prompt

Details

The CloseQuery event is fired when the page is closing, prompting the user for confirmation before closing the window/tab running the application.
 
This feature uses the JavaScript beforeUnload event. Precise implementation will depend on the browser.
 
As of version 51, Chrome no longer allows user text to be displayed.
 
Both IE version 11 and Edge will show the text as entered.
 
FireFox will only show the prompt when navigating away from the page. The prompt is not shown if the browser is closed.

Example

In this example, clicking the button will Close the page. The CloseQuery event will fire to ask for confirmation.
Begin_Com Role(*EXTENDS #PRIM_WEB)
 
   Evtroutine Handling(#sys_web.CloseQuery) Querystring(#QueryString)
 
      #QueryString := "Closing the page will end the LANSA session"
 
   Endroutine
 
End_Com

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2