Problem with query/browse reposition to a row, that is not in the first viewport

Beeb

Member
Hi!,

I have a dynmic browse filled up with a query.
The filling of the browse is located in a procedure with an input paramter with the rownumber where i want to reposition to.
When i update certain values in the browse, other values are calculated (also in other rows than the current). to show these values i fill up the browse again and i want the modified row to be selected again.
If the modified row is not in the first vieuwport (i had to scroll down to modify this record) i cannot reposition to this row, otherwise my code works fine.

Does anybody had a solution?

piece of code:

dyn-query:SET-BUFFERS(table-name).

CREATE BROWSE dyn-browse-prod
ASSIGN WIDTH = 194
HEIGHT = 24.5
EXPANDABLE = FALSE
COLUMN = 1
ROW = 1
FRAME = FRAME frm_prod:HANDLE
READ-ONLY = FALSE
SENSITIVE = TRUE
SEPARATORS = TRUE
ROW-MARKERS = TRUE
VISIBLE = TRUE
COLUMN-RESIZABLE = TRUE
TRIGGERS:
ON ROW-LEAVE PERSISTENT RUN upd_prod IN THIS-PROCEDURE.
ON ROW-DISPLAY PERSISTENT RUN disprow IN THIS-PROCEDURE.
END.

dyn-browse-prod:QUERY = dyn-query.
query-value = p_queryString.
dyn-query:QUERY-PREPARE(query-value).

dyn-query:QUERY-OPEN().
dyn-query:REPOSITION-TO-ROW(v_row).
v_select = dyn-browse-prod:SELECT-FOCUSED-ROW().

Thanks alot!

Elise
 
instead of rownumber it's better use rowid/recid to reposition on a needed record. in that case you won't have problems with viewports.
to make repositioning smoother you can use the method SET-REPOSITIONED-ROW ( 1 , "CONDITIONAL").

btw why do you need to reposition? did you try to use REFRESH method of the browser?
 
Refresh is ok when i only calculate other values in the same row (where i modified something). But some rows depend on eachother. When i modifie a value in one row, i need to change some other rows. In this case, refresh is not working (i lost the focus on my modified row).

Thanks a lot for the help.. i'll try to use rowid / recid.

greetz,

Elise
 
Back
Top