Consultor Eletrônico



Kbase P25380: How to add a SmartLink between a SmartObject that is on a SmartWindow and a SmartObject that is on o
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   21/08/2009
Status: Unverified

GOAL:

How to add a SmartLink between a SmartObject that is on a SmartWindow and a SmartObject that is on one of the SmartWindow's children objects at runtime?

FACT(s) (Environment):

Progress 9.x

FIX:

The code below adds a data link between a SmartDataBrowser that is placed on a SmartWindow's frame and a SmartDataObject that is placed on a SmartFrame, which is also placed on the SmartWindow's frame.

PROCEDURE createObjects :
/*------------------------------------------------------------------------------

Purpose: Super Override
Parameters:
Notes:
------------------------------------------------------------------------------*/

/* Code placed here will execute PRIOR to standard behavior. */

RUN SUPER.

/* Code placed here will execute AFTER standard behavior. */

ASSIGN vhContainer = DYNAMIC-FUNCTION('getContainerSource':U).
IF VALID-HANDLE(vhContainer) THEN
ASSIGN vcTargets = DYNAMIC-FUNCTION('getContainerTarget':U IN vhContainer).

DO viCounter = 1 TO NUM-ENTRIES(vcTargets):
vhChild = WIDGET-HANDLE(ENTRY(viCounter,vcTargets)).
IF DYNAMIC-FUNCTION('getObjectType':U IN vhChild) = "SmartDataBrowser":U THEN
LEAVE.
END.

IF VALID-HANDLE(vhChild) THEN
RUN addLink(INPUT h_dcustorder, INPUT "Data":U, INPUT vhChild).
END PROCEDURE.