Kbase P42786: How to Publish and Subscribe to an "add-record" event.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  17/02/2004 |
|
Status: Unverified
GOAL:
How to Publish and Subscribe to an "add-record" event with parameters?
FIX:
In order to Publish and Subscribe to an "add-record" event invoked by a SmartToolBar, one must define an input parameter to catch the passed value
and one needs to override a procedure in the SmartToolBar to pass a parameter.
For Example:
1. Create an initializeObject override procedure for a SmartWindow and subscribe to the event "add-record".
subscribe to "add-record" in h_dyntoolbar RUN-PROCEDURE "ProcedureName".
2. In ProcedureName, define an input parameter and handle the value.
DEFINE INPUT PARAMETER vName AS CHARACTER NO-UNDO.
MESSAGE vName view-as alert-box.
3. Copy a version of the SmartToolBar to your working environment so that you can edit the master.
4. Create an override procedure for onChoose of the SmartToolBar.
5. After Run Super, code the following.
If pcAction = "add" THEN PUBLISH "ADD-RECORD" ("add-record").
Now, when the application runs and Add record is selected from the SmartToolBar, the event "ADD-RECORD" is published passing along("add-record") as its parameter.