Browser: Select Row that isn't in the first viewport

dunno

New Member
Hey Guys,
at first sorry for my bad english.

I have a browser filled with records from a SDO and I want to select some rows. There is no problem if these rows are in the first viewport (12 rows in this case). But if I want to select a row out of the first viewport, for example row 25, I get this error "Invalid row index specified for browse method (385)".
There's a similar-sounding problem in this thread [thread]111121[/thread].
I tried to run this code in the initializeObject procedure.
Code:
DEFINE VARIABLE vghBrowse AS HANDLE NO-UNDO.
ASSIGN vghBrowse = DYNAMIC-FUNCTION('getBrowseHandle':U IN h_bBrowse).
vghBrowse:SET-REPOSITIONED-ROW(1, "CONDITIONAL").
This code produce a warning "**SET-REPOSITIONED-ROW is not a queryable attribute for PROCEDURE widget. (4052)".
I also tried
Code:
vghBrowse:QUERY:REPOSITION-TO-ROWID(ROWID(buffer)).
but I get an "Cannot reposition query qDataQuery to recid/rowid(s) given. (7331)" error. And I'm sure, that this record is in the SDO.

And... vghBrowse:SELECT-ALL() works.

Any idea/solutions?

btw: It's a multiple-selection browser.

Thanks alot
Marco
 

dunno

New Member
I found a solution. I have to reposition the pointer in the SDO to the record (with findRowWhere) and then call SELECT-FOCUSED-ROW().

Code:
DYNAMIC-FUNCTION('findRowWhere':U IN sdohandle,
                 INPUT 'fieldname':U,
                 INPUT 'value',
                 INPUT '':U).
vghBrowse:SELECT-FOCUSED-ROW().
 
Top