TXBrowse - Refresh() - Some Issues

Post Reply
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

TXBrowse - Refresh() - Some Issues

Post by nageswaragunupudi »

When a field of the current row in the active index is modified, if the new OrdKeyNo() is less than the oBrw:nRowSel, the browse display is incorrect even after oBrw:Refresh().

I assume this does not require any examples, because this must be of common experience or can be easily comprehended.

The work around is
if ( n := OrdkeyNo() ) < oBrw:nRowSel
oBrw:nRowSel := n
oBrw:Refresh()
endif

But programmers who face this situation for the first time should learn this work around either by trial and error or from some posting in these forums. Instead why can not the Refresh method be modified slightly?

Code: Select all

Instead of the present
    ::nRowSel  := Min(::nRowSel, ::nLen)
Substitute:
    ::nRowSel	:= Min(::nRowSel,  eval( ::bKeyNo ) )
This modification resolves this issue totally for every kind of data source.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

This also resolves display issues when changing index order or seek a value less than the present key value.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

NageswaraRao,

Fixed. many thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

NageswaraRao,

Isn't using bKeyNo going to cause a real slowdown when used with ADS?

James
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

1) Evaluation of bKeyNo does take a triffle more time. But what we dont realize is that bKeyNo keeps on getting evaluated by the xbrowse object on many occasions without our knowledge. Exampes: When bookmarks are saved, vertical scroll is operated and so on. So most of the times this extra time is not noticeable.

2) We do not use Refresh() everytime. The question is once in a while when we need a refresh, is this little extra time worth or not?

3) It is true that AdsKeyNo() does take more time. In some circumstances the time it takes can be prohibitive too. But xbrowse does not use AdsKeyNo(). Instead it uses AdsGetRelKeyPos and AdsSetRelKeyPos functions which are faster versions though approximate. Even on large tables the performance is not bad. ( My experience is with tables contation more than 500,000 rows with complex serverside filters and more than 100 users at any time).

4) Still it has to be accepted that the suggested change to Refresh method does make it slow but is it going to be perceptible when anyway bKeyNo is getting evaluated so many times even otherwise?
Regards

G. N. Rao.
Hyderabad, India
demont frank
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Post by demont frank »

Now i see in the source :

Code: Select all

::nRowSel  := Min(::nRowSel, ::nLen)
::nArrayAt := Min(::nArrayAt, ::nLen)
I try to use xbroxse so much as possible with arrays , eval(::bKeyno) gives ::nArrayAt , so i suppose it must be changed in

Code: Select all

::nArrayAt := Min(::nArrayAt, ::nLen)
::nRowSel  := Min(::nRowSel, Eval(::bKeyNo))
Frank
Post Reply