Kbase P130444: 4GL/ABL: How to navigate a MULTIPLE select browse and synchronize the browse data with fields of the
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  13/11/2009 |
|
Status: Verified
GOAL:
4GL/ABL: How to navigate a MULTIPLE select browse and synchronize the browse data with fields of the same table displayed in the same frame?
GOAL:
How to navigate a MULTIPLE select browse using the CURSOR-UP and CURSOR-DOWN keys while synchronizing displayed frame fields of the same table?
GOAL:
How to DEFINE and use a parallel query to a MULTIPLE select browse query and synchronize its displayed frame fields with those of the browse?
FACT(s) (Environment):
All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x
FIX:
The following procedure demonstrates how to define and use a parallel query to a MULTIPLE select browse query and synchronize displayed its displayed frame fields with those of the browse. It further demonstrate how to navigate a MULTIPLE select browse using the CURSOR-UP and CURSOR-DOWN keys while synchronizing the displayed frame fields of the same table. The further demonstrate how to process the selected rows at any time by pressing the 'F5' key:
/* ******************* Definitions ****************** */
DEFINE BUFFER bufCustomer FOR Customer.
DEFINE QUERY qCustomer FOR customer.
DEFINE QUERY qbufCustomer FOR bufCustomer SCROLLING.
DEFINE BROWSE bCustomer
QUERY qCustomer
DISPLAY Customer.CustNum Customer.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 .
/* *************** Control Triggers ***************** */
ON VALUE-CHANGED OF bCustomer
DO:
REPOSITION qbufCustomer TO ROWID ROWID(Customer).
GET NEXT qbufCustomer.
RUN DisplayFrameFields.
END.
ON CURSOR-UP OF bCustomer IN FRAME fCustomer
DO:
GET PREV qbufCustomer.
IF QUERY-OFF-END("qbufCustomer") THEN GET FIRST qbufCustomer.
RUN DisplayFrameFields.
END.
ON CURSOR-DOWN OF bCustomer IN FRAME fCustomer
DO:
GET NEXT qbufCustomer.
IF QUERY-OFF-END("qbufCustomer") THEN GET FIRST qbufCustomer.
RUN DisplayFrameFields.
END.
ON 'F5':U OF BROWSE bCustomer
DO:
RUN ProcessSelectedRows.
END.
/* ************************ Main ********************** */
PAUSE BEFORE-HIDE.
HIDE ALL NO-PAUSE.
OPEN QUERY qCustomer FOR EACH customer.
OPEN QUERY qbufCustomer FOR EACH bufCustomer INDEXED-REPOSITION.
ENABLE bCustomer WITH FRAME fCustomer.
GET FIRST qCustomer NO-LOCK.
APPLY "VALUE-CHANGED" TO bCustomer.
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.
/* ************** Internal Procedures *************** */
PROCEDURE DisplayFrameFields:
DISPLAY bufCustomer.CustNum bufCustomer.city WITH FRAME fCustomer.
END PROCEDURE.
PROCEDURE ProcessSelectedRows:
DEFINE VARIABLE iCounter AS INTEGER NO-UNDO.
DO iCounter = 1 TO bCustomer:NUM-SELECTED-ROWS IN FRAME fCustomer:
bCustomer:FETCH-SELECTED-ROW(iCounter).
MESSAGE Customer.CustNum Customer.NAME
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
bCustomer:DESELECT-ROWS( ).
END PROCEDURE.