Exiting VLF-One Application
Posted: Tue Apr 25, 2023 2:48 am
I am having an issue with exiting our application that I'm hoping someone will have a solution for. We have a log out button on the tool bar. The RP associated with it does nothing more than an avswitch to *EXIT. We also have axes screens that have framework locking associated with them that will popup up a message confirming that I want to leave when I try to close the panel that the axes screen is running in or when I click the log out button. We are using the avRAMP_QueryCanClose method in the IIP to accomplish this. The problem is that when I click the log out button but answer "cancel" to the confirmation message (meaning that I do not want to leave) I cannot log out after that. All I get is a message at the bottom that says "the session has ended". It also looks like the avSwith to *EXiT is what is causing the avRAMP_QUeryCanClose to be called. It almost looks like internals of the application thinks it has logged out but it hasn't. I can still navigate the application fine. The only thing that I cannot do is log out. Wondering what I am doing wrong.
Logout RP
avRAMP_QueryCanClose in the IIP (code has been removed for simplicity)
Trying to log out the first time
Trying to logout the second time
Logout RP
Code: Select all
Begin_Com Role(*EXTENDS #VF_AC010O)
Mthroutine Name(uExecute) Options(*REDEFINE)
* Do the ancestor thing
Invoke Method(#Com_Ancestor.uExecute) Gotofreestate(#GotoFreeState) Switchcallerreference(#SwitchCallerReference)
* Switch to exit at the framework level
#avFrameworkManager.avSwitch Caller(#USYSTEM.MainVLFPanel) Toobjectnamed('*EXIT')
Endroutine
End_Com
Code: Select all
Mthroutine Name(avRAMP_QueryCanClose) Options(*REDEFINE)
Define_Com Class(#PRIM_DC.UnicodeString) Name(#LockMsg) Value('You have chosen to leave this page, which will result in unsaved data being lost. Are you sure you want to continue?')
#Allow := (#SYS_WEB.Confirm( (#LockMsg) ) = OK)
Endroutine