Kbase P95235: How to use the SELECT-FOCUSED-ROW method?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  14/11/2005 |
|
Status: Verified
GOAL:
How to use the SELECT-FOCUSED-ROW method?
GOAL:
How to use 4GL to select a specific record in a browse widget?
GOAL:
How to highlight a record in a multiple-selection browse?
FIX:
The following is an example of how to reposition a browse using the SELECT-FOCUSED-ROW method to a specific record. In this case this is the first customer record with a name beginning "G".
DEFINE VARIABLE curr-rec AS ROWID.
DEFINE VARIABLE status-ok AS LOGICAL.
DEFINE BUTTON Repos LABEL "Reposition".
DEFINE QUERY qry FOR customer.
DEFINE BROWSE brws QUERY qry DISPLAY cust-num name country credit-limit
WITH 10 DOWN MULTIPLE.
FORM brws SKIP(1) Repos
WITH FRAME brws-frame.
ON CHOOSE OF repos DO:
FIND FIRST customer WHERE NAME BEGINS "G" NO-LOCK.
curr-rec = ROWID(customer).
REPOSITION qry TO ROWID curr-rec.
status-ok = brws:SELECT-FOCUSED-ROW().
IF NOT status-ok
THEN MESSAGE "Could not select row.".
END.
OPEN QUERY qry PRESELECT EACH customer.
ENABLE ALL WITH FRAME brws-frame.
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.