PDA

View Full Version : What's the point of PagingToolbar ?



mahadewa
4 Feb 2008, 10:16 AM
Well, I know what PagingToolbar is for, principally. I've just tried to implement this myself.
What I don't get is the part where, on the server code, we need to pass the 'totalProperty' everytime the Ajax call from the PagingToolbar is run (i.e. when we click 'Next').
Now, maybe I just don't know how to do this, but if we have to count the number of 'all' data so that we can pass it to 'totalProperty', everytime, doesn't it defeat the purpose of Paging ?

Or, maybe I just don't get it.
Anybody can give me pointer here ? How do you pass around the 'totalProperty' between Ajax call so you don't have to re-calculate the total everytime ?

Thanks in advance.

ferr
4 Feb 2008, 12:18 PM
You pass the total property in order to know the total numbers of pages (i.e. Page [ 3 ] of 120 will show up in your tool bar). In my experience I have found it best to rely on a recalc every time because what I am displaying in my grid has the potential of being added/removed at any given time, and displaying false information (i.e. the same totalProperty after a record has been added/removed) may be harmful to your users. I don't think it would be easy to work around a recalc.. it would end up along the lines of getting the total on the initial load through an alternate connection, then using those results as your total property for your data store's total property.. somehow. Maybe someone else has done it. I'm not sure why you would want to do this.

As far as I know calling something like "select count(*) from reallyBigTable_dbt" to get the count at the same time as your page update isn't very intensive at all, if that's your worry.

mahadewa
5 Feb 2008, 2:58 AM
Yes, that's exactly what I'm worry about, the cost of doing select count on every page.
I guess, I have to live with it then.

== CASE CLOSED ==