Consultor Eletrônico



Kbase P49392: How to pass values to a Smart Window from a regular non-smar
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   28/10/2003
Status: Unverified

GOAL:

How to pass values to a Smart Window from a regular non-smart window?

FACT(s) (Environment):

Windows

FACT(s) (Environment):

Progress 9.1x

FIX:

The following code snippet uses the ADM2 setUserProperty function to send the current customer number value as a string to a smart window:

DO:
DEFINE VARIABLE hSmartWindow AS HANDLE NO-UNDO.
FIND CURRENT customer NO-LOCK NO-ERROR.
IF AVAILABLE customer THEN DO:
IF NOT VALID-HANDLE(hSmartWindow) THEN DO:
RUN smartWindow.w PERSISTENT SET hSmartWindow.
RUN initializeObject IN hSmartWindow.
DYNAMIC-FUNCTION('setUserProperty':U IN hSmartWindow,
INPUT "cPropertyName" /* CHARACTER */,
INPUT STRING(CustNum) /* CHARACTER */).
END.
ELSE DO:
DYNAMIC-FUNCTION('setUserProperty':U IN hSmartWindow,
INPUT "cPropertyName" /* CHARACTER */,
INPUT STRING(CustNum) /* CHARACTER */).
END.
END.
END.

The following code snippet uses the ADM2 getUserProperty function to make the current customer number value sent by the above code available inside the smart window:

DEFINE VARIABLE cPropertyValue AS CHARACTER NO-UNDO.
cPropertyValue = DYNAMIC-FUNCTION('getUserProperty', 'cPropertyName').
MESSAGE cPropertyValue
VIEW-AS ALERT-BOX INFO BUTTONS OK.