This makes perfect sense.

I guess the fact that my current implementation worked before, then suddenly
stopped working threw me off.


Thanks for the explanation!!



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Igor Vaynberg
Sent: 9 February 2006 17:43
To: [email protected]
Subject: Re: [Wicket-user] DataView and iterator


keep in mind that idataprovider and dataview are there to display large
datasets using paging.

the first thing the dataview needs to know is the total amount of items that
is available. so the first thing that is called is IDataProvider.size().

after this is retrieved the dataview can figure out how many total pages
there are by dividing size by the number of items per page you have
configured.

after this the dataview is ready to retrieve the page of data it will
display, so IDataProvider.iterator(int first, int count) is called. first is
the offset of data (page_number*items_per_page), the count is the number of
rows that are needed, min(items_per_page, size-(page_number*items_per_page))

hope this explains it.

-Igor





On 2/9/06, David Leangen <[EMAIL PROTECTED]> wrote:
On Wed, 2006-02-08 at 23:14 -0800, Igor Vaynberg wrote:
> this is interesting, could you make sure your implementation of
> IDataProvider.size() returns a number > 0

Interesting, indeed. You just helped me find the problem, though I'm not
yet sure of the proper solution.

My previous assumption was this:

  DataView requests data from IDataProvider
    (with start and count) in method "iterator"

  IDataProvider uses this info to retrieve data
    also updates "size" with this data


This seemed logical, since the size of the data is not known until it is
requested (or so I thought), and the request (at least in my case,
because I need to send the start and count index with the request) is
not know until "iterator". And in any case, this always worked for me
previously.


This time, though, if I fill in a dummy, non-zero value for size(), I am
getting back results... so it appears that my previous assumption was
not correct.


So where and how should data be retrieved, if not in
IDataProvider.iterator(int,int)?





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to