Progress
Programming
Handbook


Repositioning Focus

The browse and the query must remain in sync. At times, you might have to do some behind-the-scenes manipulation of the results list. To resync, you can use the REPOSITION statement. The REPOSITION statement:

To avoid display flashing when doing programmatic repositions, you can set the REFRESHABLE attribute to FALSE, do the REPOSITION, and then set REFRESHABLE to TRUE.

The SET–REPOSITIONED–ROW( ) method gives you control over the position in the viewport where the browse will display the repositioned row.

The code fragment below demonstrates these techniques:

method-return = browse1:SET-REPOSITIONED-ROW(3,"CONDITIONAL"). 
    /* Displays the record at row 3 with focus, unless the record 
       is already in the viewport. In this case, the record receives  
       focus at its current row. */ 
   . 
   . 
   . 
ON CHOOSE OF b-find-cust 
DO: 
    FIND FIRST customer WHERE /* your selection criteria */. 
    ASSIGN temp-rowid = ROWID(customer) 
           browse1:REFRESHABLE = NO. 
    REPOSITION query1 TO ROWID temp-rowid. 
    ASSIGN browse1:REFRESHABLE = YES. 
END. 

Note that SET–REPOSITIONED–ROW( ) is normally set once for the session. You can also use the GET–REPOSITIONED–ROW( ) method to find out the current target row for repositions.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095