On a page you don't have access to the system buttons like OK or Cancel.
You need to rewrite your code to use the OnQueryClosePage method. There you can check which action was performed by:
OnQueryClosePage(CloseAction : Action None) : Boolean
IF CloseAction = Action::OK THEN
Comments
You need to rewrite your code to use the OnQueryClosePage method. There you can check which action was performed by: