Kbase 17498: How to Bypass a Leave Trigger when Clicking a Cancel Button
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
How to Bypass a Leave Trigger when Clicking a Cancel Button
INTRODUCTION:
=============
The following code will (when attached to a LEAVE trigger) bypass the
execution of the code in the trigger when the user clicks a "Cancel"
button.
WHY YOU NEED TO KNOW THIS:
===========================
You need this when you want LEAVE trigger validation but still want
the user to be able to cancel a screen at any time.
CAVEATS:
========
One thing to keep in mind is that field level validation, in general,
is not a recommended thing to do in a Windows environment.
ASSUMPTIONS:
============
The following code fragment assumes that your window has a cancel
button on it which is named pbnCancel.
ON LEAVE OF <SomeWidget>
DO:
IF LAST-EVENT:EVENT-TYPE = "PROGRESS":U AND
LAST-EVENT:WIDGET-ENTER = pbnCancel:HANDLE THEN
RETURN.
/* Normal Leave Code Goes Here */
END.
RELATED KNOWLEDGEBASE ENTRIES:
==============================
14095 - Why LEAVE Trigger Data Validation is a Bad Idea
15185 - Event Driven GUI Programming vs. Procedure Driven V6 Style
Progress Software Technical Support Note # 17498