Kbase P58752: How to re-open an SDO query on another folder page
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/30/2003 |
|
Status: Unverified
GOAL:
How to refresh an SDO query on another folder page.
GOAL:
How to open an SDO query on another dynamic folder page.
FACT(s) (Environment):
Dynamics 2.1A
FIX:
Get the handle to the container window. Then using the container handle, search for the instance of the contained SDO before re-opening its query with 'openQuery'.
The following code is taken from a dynamic button placed on a viewer on one page of a dynamic folder. The idea is to re-open the query of an SDO (billtofullo) on another page of the container.
DEFINE VARIABLE hWindowHandle AS HANDLE NO-UNDO.
DEFINE VARIABLE hContainerSource AS HANDLE NO-UNDO.
DEFINE VARIABLE OType AS CHARACTER NO-UNDO.
DEFINE VARIABLE OName AS CHARACTER NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE ContainerTargets AS CHARACTER NO-UNDO.
DEFINE VARIABLE h_SDO AS HANDLE NO-UNDO.
{get ContainerSource hContainerSource}.
ContainerTargets = DYNAMIC-FUNCTION('getContainerTarget':U IN hContainerSource).
IF ContainerTargets NE "" THEN
DO:
DO i = 1 TO NUM-ENTRIES(ContainerTargets):
h_SDO = WIDGET-HANDLE(ENTRY(i,ContainerTargets)).
OType = DYNAMIC-FUNCTION('getObjectType':U IN h_SDO).
OName = DYNAMIC-FUNCTION('getObjectName':U IN h_SDO).
IF OName = 'billtofullo' AND OType = 'SmartDataObject' THEN
DO:
DYNAMIC-FUNCTION('OpenQuery':U IN h_SDO).
END.
END.
END.
In this example it may be necessary to run 'initPages' in a container initializeObject override, in order to ensure all objects are running when the above code is executed.