Browse widget multiselect scrolling

Taaje

New Member
Hi,

I am having a problem with browsing in a multiple select browser. I have created a window with a multiselect browse and an editor that should show the value of a field from the browse record that has the focus.
The problem is that Progress only puts a record from a browser in the record buffer when that record is selected so I cannot display the value of the field in the editor by simply scrolling through the browser.

Is there another way to retrieve the value of a field of the focused record without it being put in the record buffer. Or how can I put the focused record in the record buffer?

Grtz,

Taaje
 

MHotovec

Member
Below is something that is working for me.
b-ordi is my browser.
t-ordi is a temp table.
both frames are defined elsewhere in the code.

Basically any time the user cursors up or down I display 4 different fields in two different frames.

Note, this particular browser is NOT a multiselect browser. Here's to hoping that doesn't make difference. (I wouldn't THINK that it would, but sometimes Progress surprises us now doesn't it).

Hope this helps.
Mark


on value-changed of b-ordi do:
disp
t-ordi.qtyshp
t-ordi.qtypick
t-ordi.picknum
with frame f-pickinf.

v-descr = t-ordi.descr.
disp v-descr with frame f-newline.
end.
 

Taaje

New Member
Thanks for answering but this will not help. It does make a difference if it is a multiselect browser.
In the case of a single-select browser, everytime you move to another record, this record is put in the record-buffer so it is always accessible. In case of a multiselect browser, the record moved to is not put in the record buffer.

I have already tried several things but nothing seems to work completely. The code I have written works for as long as the viewport of the browser does not change. After that, troubles begin...
 

arekp

New Member
I had the same problem with multiselect browser, but I resolved it.

When you change position in browse, you have to shortly select and (if necessary) unselect row in browse. After this your data in frame will be updated automatically.

I use this idea in CHUI and I override CURSOR-UP and CURSOR-DOWN triggers like this:

DEF VAR i AS INTEGER.
.....
ON CURSOR-UP OR CURSOR-DOWN OF BROWSE-1
DO:
i = browse BROWSE-1:NUM-SELECTED-ROWS.
browse BROWSE-1:SELECT-FOCUSED-ROW()
DISPLAY..........
IF i <> browse BROWSE-1:NUM-SELECTED-ROWS THEN
browse BROWSE-1:DESELECT-FOCUSED-ROW().
END.

Maybe this idea is not very preaty but it's work.
Maybe in GIU you have to use other triggers then CURSOR-UP na DOWN.

Arek Panas
 

Taaje

New Member
Thanks,

I've finally found the solution based on your code.
One remark though, I've tried your code first but then the editor always displayed the record which was previously focused and not the record which is focused after the cursor event.

I changed the code for CURSOR-UP a bit:

i = browse BROWSE-1:NUM-SELECTED-ROWS.
browse BROWSE-1:SELECT-FOCUSED-ROW().
GET PREV BROWSE-1.
IF AVAILABLE dbname.tblname
THEN ASSIGN edt-data:SCREEN-VALUE=dbname.tblname.fldname.
GET NEXT BROWSE-1.
IF i <> browse BROWSE-1:NUM-SELECTED-ROWS THEN
browse BROWSE-1:DESELECT-FOCUSED-ROW().

This seemed to work (for cursor-down something similar).

Greetz,

Taaje
 
Top