Focus an nth row in a browse

Yes U can do it without reposition, though that is more tidy.
It moves UI focus to the selected row, and puts that record in the record buffer.
BFN
 
Greetings dude,

This is simply:
{&BROWSE-NAME}:select-row (i).

I is the variable to the row that U wish to select.
Be careful the row has to be in the UI / Record buffer. So selecting row 75 is not possible.
Typically only around 7 rows are displayed in the browse widget.
Hope this helps
 
Is there any way I can select a row that is not currently in the browse view-port?
I have a multi-select browse and when I select a record in the browse, I need the program to select to select other dependent rows in the browse.
I have looped through the num-results of the query, matched my condition and used <browse>:SELECT-ROW(i). This works for all rows that are currently in the browse view-port. But gives me an error - "Invalid row index specified for browse method SELECT-ROW (385)" if the row is out of the view-port. Is there any way, I can select all dependent rows even though they are not in the browse view-port?

Here is what I am doing:

ON 'VALUE-CHANGED':U OF <mybrowse> IN FRAME <myframe>
DO:
IF (<mybrowse>:FOCUSED-ROW-SELECTED IN FRAME <myframe>) THEN
DO:
GET FIRST <myquery>.

DO i = 1 TO NUM-RESULTS("<myquery>"):
IF <mycondition> THEN
<mybrowse>:SELECT-ROW(i).

GET NEXT <myquery>.
END.
END.
END.
 
get first {&BROWSE-NAME}.
i = 0.
do while NOT QUERY-OFF-END ( "{&BROWSE-NAME}" ) :
i = i + 1.
find first selitems where selitems.rid-doc = orders.rid-doc NO-LOCK NO-ERROR.
if available selitems then
do:

REPOSITION {&BROWSE-NAME} TO ROW i.
{&BROWSE-NAME}:SELECT-FOCUSED-ROW() IN FRAME {&FRAME-NAME} NO-ERROR.
end.
get next {&BROWSE-NAME}.
end.
get first {&BROWSE-NAME}.
REPOSITION {&BROWSE-NAME} TO ROW 1.
 
Back
Top