Kbase P138805: How to leave an updatable simple browse when the user presses the TAB key while at the last cell of
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  18/12/2008 |
|
Status: Unverified
GOAL:
How to leave an updatable simple browse when the user presses the TAB key while at the last cell of the last row of the browse?
GOAL:
How to leave an updatable non-Smart browse when the user presses the TAB key while at the last cell of the last row of the browse?
FACT(s) (Environment):
Windows
OpenEdge 10.x
FIX:
Define a LEAVE or TAB trigger on the last column in the browse that looks like this:
DO:
IF NUM-RESULTS("myBrowseName") = CURRENT-RESULT-ROW("myBrowseName") THEN
DO:
RUN ApplyEntryToParentWindow.
RETURN NO-APPLY.
END.
END.
ApplyEntryToParentWindow will be different depending on whether static or dynamic widgets are being used. For a static frame and widgets, ApplyEntryToParentWindow will look like this:
/*----------------------------------------------------------------------
Purpose: Apply entry to the first widget of the frame.
Parameters: <none>
Notes:
------------------------------------------------------------------------*/
APPLY 'ENTRY' TO myNextWidget IN FRAME myFrame.
END PROCEDURE.
For a dynamic frame and widgets, ApplyEntryToParentWindow will look like this:
/*----------------------------------------------------------------------
Purpose: Get the handle of the first widget of the default frame and apply entry to it.
Parameters: <none>
Notes:
------------------------------------------------------------------------*/
DEFINE VARIABLE h AS HANDLE NO-UNDO.
ASSIGN
h = FRAME {&FRAME-NAME}:FIRST-CHILD
h = h:FIRST-CHILD.
APPLY 'ENTRY' TO h.
END PROCEDURE.
Hand edit the OPEN QUERY statement for the browse query to read PRESELECT EACH instead of FOR EACH. Note that if you later make changes to the source file using the AppBuilder, the AppBuilder will write over this change and you will have to change it back to PRESELECT.