TXBrowse - Refresh() - Some Issues

TXBrowse - Refresh() - Some Issues

Postby nageswaragunupudi » Sat Jan 12, 2008 3:20 am

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  Expand view  RUN
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: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby nageswaragunupudi » Sat Jan 12, 2008 3:25 am

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
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Antonio Linares » Sat Jan 12, 2008 7:21 am

NageswaraRao,

Fixed. many thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » Sat Jan 12, 2008 7:57 am

NageswaraRao,

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

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby nageswaragunupudi » Sat Jan 12, 2008 8:38 am

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
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby demont frank » Sat Jan 12, 2008 9:30 am

Now i see in the source :

Code: Select all  Expand view  RUN
::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  Expand view  RUN
::nArrayAt := Min(::nArrayAt, ::nLen)
::nRowSel  := Min(::nRowSel, Eval(::bKeyNo))


Frank
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 65 guests