VLF-ONE Back Button / Back Space
Posted: Sat Jul 20, 2019 12:19 am
A lot of our users are complaining about hitting the back space in VLF-ONE and it taking them back a page like the back button.
I recognize that this is a browser issue and that Chrome removed that "feature" and FireFox has a way to disable it. IE and Edge however still behave that way and a lot of our users STILL use IE 11.
This post viewtopic.php?f=3&t=2117&p=5672 pointed me to the SYS_WEB.CloseQuery and using VLF-ONE already has an event handler to terminate the framework.
I thought I may be able to use this to ask the user if they meant to close the page, however there does not seem to be a way to get the response from the user, so even if the user selects cancel, it still kills the VLF-ONE session.
For example, if I modify the above the handler as such
The prompt displays, yet,if the user selects "cancel", the VLF-ONE.uTerminate is still invoked.
Normal javascript confirm boxes have a boolean that refers to the user response, so I've tried to do something like this
But this still does not stop the page from closing.
Any way to gracefully handle this?
It would be nice if SYS_WEB.CloseQuery included a canceled boolean or something to indicate what the user chose, or a way to cancel the page navigation.
Thanks,
Joe
I recognize that this is a browser issue and that Chrome removed that "feature" and FireFox has a way to disable it. IE and Edge however still behave that way and a lot of our users STILL use IE 11.

This post viewtopic.php?f=3&t=2117&p=5672 pointed me to the SYS_WEB.CloseQuery and using VLF-ONE already has an event handler to terminate the framework.
Code: Select all
evtroutine handling(#SYS_WEB.CloseQuery)
if (#VLF_ONE *IsNot *null)
* Cancellation is not possible from here so always use possibletocancel(False)
#VLF_ONE.uTerminate possibletocancel(False) browserisclosing(True)
endif
endroutine
For example, if I modify the above the handler as such
Code: Select all
evtroutine handling(#SYS_WEB.CloseQuery) querystring(#pQueryString)
#pQueryString := "Are you sure you want to leave the page?"
if (#VLF_ONE *IsNot *null)
* Cancellation is not possible from here so always use possibletocancel(False)
#VLF_ONE.uTerminate possibletocancel(False) browserisclosing(True)
endif
endroutine
Normal javascript confirm boxes have a boolean that refers to the user response, so I've tried to do something like this
Code: Select all
evtroutine handling(#SYS_WEB.CloseQuery)
#SYS_WEB.Console.Log( "SYS_WEB.CloseQuery" )
if (#SYS_Web.Confirm( "Are you sure you want to leave the page?" ) = OK)
#SYS_WEB.Console.Log( "Confrimation OK" )
if (#VLF_ONE *IsNot *null)
#SYS_WEB.Console.Log( "Terminating VLF-ONE" )
* Cancellation is not possible from here so always use possibletocancel(False)
#VLF_ONE.uTerminate possibletocancel(False) browserisclosing(True)
endif
else
#SYS_WEB.Console.Log( "Confirmation CANCEL" )
endif
endroutine
Any way to gracefully handle this?
It would be nice if SYS_WEB.CloseQuery included a canceled boolean or something to indicate what the user chose, or a way to cancel the page navigation.
Thanks,
Joe