Browser jumps to first record after update 
Author Message
 Browser jumps to first record after update

G'day Anton!

Quote:
>after updating a record from a browser and returning to the
>browser, the updated record is displayed as the first one in
>the list, even if it was in the center of the list before the update.
>Does anybody know a template enhancement that fixes
>this behaviour? I think the record should stay where it was before
>the update. I also noticed that it does not change its position if
>the update is cancelled.

I had a similar occasion to want to return to the browse with the same
record highlighted. I raised the question during an IRC chat session.
What follows is courtesy of Pierre Tremblay, who kindly took the time
to come up with the following:

Quote:

>I finaly got some times to check how to "shortcut" the std behavior of the
>std browse to only redisplay selected row when the user back from an
>update.
>I will tell you: The solution is very ugly. I will explain you why.
>The reason why the browse is acting like that (bring the selected record on
>top) is because the code is not aware if the user changed one the
>components of the key. Doing this will invalidate the position of the view
>retained in the Queue:Browse. What has also to be considered is the fact
>that the app can be used in a multiuser system. The reloading of the page
>insure that new records, if any, will appear. Now, if we are absolutely
>sure that the key components arent changed, you will be able to use this
>little code snippet in an appropriate embed point. I tested ok here, so I
>hope it will be ok at your end.

if GlobalResponse = RequestCompleted
  open(BRW1::View:Browse)
  get(Queue:Browse, choice(?List))
  reset(BRW1::View:Browse, Queue:Browse.BRW1::Position)
  next(BRW1::View:Browse)
  do BRW1::FillQueue
  put(Queue:Browse)
  display(?List)
  exit
end

        ----------------------------------------------------------

Anton, this also tested ok with me. To re-iterate Pierre's warning, it
should only be used where you are certain the record you are updating
cannot change one of the key components, so use with care.

I embed it into my code as a Routine called BRW1::RefreshLine. One day
I hope to write it up as a template extension, as I now found him a
very handy little routine to have around.

Best  Regards
--
Steve Greenwood
HiCaliber Software



Mon, 26 Jul 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. C4a Highlight bar on first record in queue returning from update

2. Record Date and Time Record Updated

3. Jumping record selector

4. Force browse to jump at specific record

 

 
Powered by phpBB® Forum Software