Consultor Eletrônico



Kbase P111292: Is it possible to invoke the code of a generic, ANYWHERE trigger from a widget-level trigger for the
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

Is it possible to invoke the code of a generic, ANYWHERE trigger from a widget-level trigger for the same event

FIX:

No, it's not possible.

For example, if you have:

ON 'ROW-DISPLAY':U ANYWHERE
DO:
... generic code ...
END.

and then a widget-level trigger like:

ON 'ROW-DISPLAY':U OF brBrowse IN FRAME fFrame
DO:
... widget-specific code ...
END.

then there is no direct way to invoke the ANYWHERE ROW-DISPLAY trigger from the browser-specific one.

One possible solution is to move the code for the ANYWHERE trigger into an internal procedure and then use the PUBLISH/SUBSCRIBE mechanism from but the ANYWHERE and the widget-level trigger. For example:

/* Generic trigger definition. */
ON 'ROW-DISPLAY':U ANYWHERE
DO:
PUBLISH "genericRowDisplay" (SELF).
END.

/* Specific trigger. */
ON 'ROW-DISPLAY':U OF brBrowser IN FRAME fFrame
DO:
.... widget-specific code ....
PUBLISH "genericRowDisplay" (SELF).
END.


/* Some procedure will do the following: */
SUBSCRIBE PROCEDURE THIS-PROCEDURE TO "genericRowDisplay" ANYWHERE.

PROCEDURE genericRowDisplay:
DEFINE INPUT PARAMETER phBrowse AS HANDLE NO-UNDO.
.... generic code ...
END.