Consultor Eletrônico



Kbase P130192: 4GL/ABL: How to navigate a MULTIPLE select browse using the CURSOR-UP and the CURSOR-DOWN events.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   07/04/2008
Status: Unverified

GOAL:

4GL/ABL: How to navigate a MULTIPLE select browse using the CURSOR-UP and the CURSOR-DOWN events.

GOAL:

How to navigate a MULTIPLE select browse using the Up Arrow and the Down Arrow keys.

GOAL:

How to apply the VALUE-CHANGED event on the CURSOR-UP and the CURSOR-DOWN events of a MULTIPLE select browse.

FACT(s) (Environment):

All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x

FIX:

The following procedure demonstrates how to navigate a MULTIPLE select browse using the Up Arrow and the Down Arrow keys and how to apply the VALUE-CHANGED event from the CURSOR-UP and the CURSOR-DOWN events triggers of a MULTIPLE select browse:
DEFINE QUERY qCustomer FOR Customer.
DEFINE BUFFER bufCustomer FOR customer.
DEFINE BROWSE bCustomer
QUERY qCustomer
DISPLAY CustNum name
WITH 5 DOWN MULTIPLE TITLE "Customer Browse".

DEFINE FRAME fCustomer
bCustomer SKIP(2)
"Num: " bufCustomer.CustNum NO-LABEL
"City:" bufCustomer.city NO-LABEL SKIP(1)
WITH SIDE-LABELS AT ROW 2 COLUMN 2 OVERLAY.
/* ------------ VALUE-CHANGED Trigger ------------- */
ON VALUE-CHANGED OF bCustomer
DO:
DISPLAY bufCustomer.CustNum bufCustomer.city WITH FRAME fCustomer.
END.
/* -------------- CURSOR-UP Trigger --------------- */
ON CURSOR-UP OF bCustomer IN FRAME fCustomer
DO:
FIND PREV bufCustomer NO-LOCK NO-ERROR.
IF ERROR-STATUS:ERROR THEN
FIND FIRST bufCustomer NO-LOCK NO-ERROR.
APPLY "VALUE-CHANGED" TO BROWSE bCustomer.
END.
/* -------------- CURSOR-DOWN Trigger ------------- */
ON CURSOR-DOWN OF bCustomer IN FRAME fCustomer
DO:
FIND NEXT bufCustomer NO-ERROR.
IF ERROR-STATUS:ERROR THEN
FIND LAST bufCustomer NO-LOCK NO-ERROR.
APPLY "VALUE-CHANGED" TO BROWSE bCustomer.
END.
/* -------------- MAIN --------------- */
PAUSE 0 BEFORE-HIDE.
OPEN QUERY qCustomer FOR EACH Customer.
FIND FIRST bufCustomer NO-LOCK NO-ERROR.
APPLY "VALUE-CHANGED" TO BROWSE bCustomer.
ENABLE bCustomer WITH FRAME fCustomer.
WAIT-FOR WINDOW-CLOSE OF THIS-PROCEDURE.