Consultor Eletrônico



Kbase P21939: How to reposition an updatable browse to the row clicked on
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   27/06/2003
Status: Unverified

SYMPTOM(s):

How to reposition an updatable browse row to the top of the view when the user mouse clickes or mouse double clicks it if the ROW-LEAVE trigger deletes the currently selected row?

FIX:

1. ROW-LEAVE trigger:
DO:
lMethod-Status = BROWSE-1:DELETE-CURRENT-ROW().
lNewRow-Status = TRUE.
iStart-Row = BROWSE-1:FOCUSED-ROW.
END.


2. VALUE-CHANGED trigger:
DO:
iFinish-Row = BROWSE-1:FOCUSED-ROW.
IF lNewRow-Status = TRUE THEN DO:
FIND CURRENT customer NO-LOCK NO-ERROR.
IF AVAILABLE Customer THEN DO:
rRowid-Customer = ROWID(Customer).
REPOSITION browse-1 TO ROWID rRowid-Customer.
IF iStart-Row > iFinish-Row THEN
REPOSITION browse-1 BACKWARDS 1.
ELSE
REPOSITION browse-1 BACKWARDS 2.
lNewRow-Status = FALSE.
END.
END.
END.