Kbase P71407: Dyn: Session with AppServer, pressing next button goes to wr
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/03/2004 |
|
Status: Unverified
FACT(s) (Environment):
Dynamics 2.1A
FACT(s) (Environment):
Progress 9.1D
SYMPTOM(s):
Session with AppServer (ICFRUNTIME)
Pressing next button goes to wrong row in a SDB
Container has just been launched
Container launched from a treeview based menu
Dynamics 2.1A01
Progress 9.1D07
CAUSE:
The real cause of this problem has not been identified at the time of writing.
The problem has something to do with applying ENTRY to the browse widget when the focus is coming from a non 4GL widget (container launched from a treeview based menu) and is very hard to reproduce.
FIX:
The following override of applyEntry solves the problem. It should be implemented in adm2/custom/containrcustom.p:
PROCEDURE applyEntry:
DEFINE INPUT PARAMETER pcField AS CHARACTER NO-UNDO.
DEFINE VARIABLE cContainerTarget AS CHARACTER NO-UNDO.
DEFINE VARIABLE hContainerHandle AS HANDLE NO-UNDO.
DEFINE VARIABLE iNumObjects AS INTEGER NO-UNDO.
DEFINE VARIABLE iCount AS INTEGER NO-UNDO.
DEFINE VARIABLE hObject AS HANDLE NO-UNDO.
DEFINE VARIABLE lObjectEnabled AS LOGICAL NO-UNDO.
RUN SUPER (INPUT pcField).
{get ContainerHandle hContainerHandle}.
IF CAN-QUERY(FOCUS, 'WINDOW') THEN DO:
/* The focus is already in a widget of the container window */
IF FOCUS:WINDOW = hContainerHandle THEN RETURN.
END.
/* Either the focus is not on the right window, or we cannot query the WINDOW
attribute (non 4GL widget ? OCX?)
Anyway, let's not assume that the FOCUS is on the right window, so we carry on*/
/* let's try to do better now, such as catching a Browse */
cContainerTarget = DYNAMIC-FUNCTION('getContaineRTarget' IN TARGET-PROCEDURE).
iNumObjects = NUM-ENTRIES(cContainerTarget).
DO iCount = 1 TO iNumObjects:
hObject = WIDGET-HANDLE(ENTRY(iCount,cContainerTarget)).
IF NOT VALID-HANDLE(hObject) THEN NEXT.
IF NOT DYNAMIC-FUNCTION('instanceOf' IN hObject, "Browser") THEN NEXT.
{get ObjectEnabled lObjectEnabled hObject}.
IF NOT lObjectEnabled THEN NEXT.
RUN applyEntry IN hObject ("").
RETURN.
END.
END PROCEDURE.