Consultor Eletrônico



Kbase P143128: ADM2: How to enable a SmartDataField of a SmartDataViewer contained in a SmartDialog?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/17/2009
Status: Unverified

GOAL:

ADM2: How to enable a SmartDataField of a SmartDataViewer contained in a SmartDialog?

GOAL:

How to check whether a handle returned by the DYNAMIC-FUNCTION 'getEnabledHandles' is a SmartDataField handle?

GOAL:

How to use the CAN-QUERY function to check if a given handle is a Procedure handle?

GOAL:

How to call the enableField procedure and invoke the DYNAMIC-FUNCTION 'setEnableField' to enable a SmartDataField?

FACT(s) (Environment):

Windows
Progress 9.x
OpenEdge 10.x

FIX:

Add the following code after the RUN SUPER statement of the local initializeObject procedure of the SmartDialog:

RUN addLink(hSDO, 'Data', h_vorder).
RUN addLink(h_vorder, 'Update', hSDO).
RUN enableFields IN h_vorder.
RUN dataAvailable IN h_vorder('DIFFERENT').
ASSIGN
cEnabledFieldHandleList = DYNAMIC-FUNCTION('getEnabledHandles':U IN h_vorder) NO-ERROR.
DO iLoopCounter = 1 TO NUM-ENTRIES (cEnabledFieldHandleList):
ASSIGN
hCurrentObjectHandle = WIDGET-HANDLE (ENTRY (iLoopCounter, cEnabledFieldHandleList)).
/* If the object is a procedure (i.e. a SmartDataField procedure), then enable its field */
IF CAN-QUERY(hCurrentObjectHandle, 'FILE-NAME':U) THEN DO:
RUN enableField IN hCurrentObjectHandle NO-ERROR.
DYNAMIC-FUNCTION('setEnableField':U IN hCurrentObjectHandle, YES) NO-ERROR.
END.
ELSE /* The object is simply one of the SmartDataView fields, simply make it sensitive */
hCurrentObjectHandle:SENSITIVE = TRUE.
END.