Progress 10.2B08
I feel really silly asking this to be honest! I'm trying to solve a problem with some legacy code. It's trawling through a browse and doing some stuff with the data. It does a reposition-to-row(). This works great, until the row selected is outside the usual view of the browse. After that it just selects the last row in the view rather than the actual row it should be selecting.
I hope I've explained that well enough.
Does anyone know how I can get the code to select a row that's not in the actual viewable range? I'm sure it's something I've done before.
So I've found the solution. The bottom row of the browse was slightly chopped off. I increased the height of the widget marginally and it's working fine. What a crazy solution!
Is the browser connected to an ADM2 SDO? If so you could reposition in the SDO using functions like findRowWhere & fetchRowIdent
I think it's just ADM1 actually. But I can't make it too specific as it's generic code that drops the content of a browse out to excel.
Thanks Tom. I've been trying to work out how to use that solution, but the issue is that the browse in question has columns in it that are based on variables, and not database buffers. Therefore a reposition to rowid will not necessarily find the correct record. In this browse I think it will, but there are other browses where it won't.
If it is not a preselect query, then the num-results is not reliable, unless you have scrolled all the way to the end of the browse at least once. That's probably why giving any row that is higher than the current num-results (while you haven't scrolled to the end yet) ends up with the currently last row in the view...
Try it it is the same problem
So I've found the solution. The bottom row of the browse was slightly chopped off. I increased the height of the widget marginally and it's working fine. What a crazy solution!
Use the following trick to ensure a browse always shows whole rows...
BROWSE myBrowse:DOWN = BROWSE myBrowse:DOWN.
Thanks Lieven. Can I also use the same trick in an external .p using the browse's handle?
I guess so (haven't tried...)