Paging Issues

Posts   
 
    
Posts: 37
Joined: 21-Oct-2004
# Posted on: 23-Oct-2004 03:37:42   

I've got a general paging issue, which is that it doesn't seem to work. I'm using SQL Server, and have no other problems so far. There are two issues I'm experiencing, which may be related. The first occurs with the following code:


MetadataSourceCollection Items = new MetadataSourceCollection();
Items.GetMulti(this.Filter, 0, null, null, this.CurrentPage, this.PerPage);

The problem is that this doesn't restrict the number of items displayed at all. It still displays everything it can find. It also doesn't do anything when I change the current page. Filter is just a null filter, or a like filter on a text field.

The second is when I change the code to this:


MetadataSourceCollection Items = new MetadataSourceCollection();
Items.GetMulti(this.Filter, this.PerPage, null, null, this.CurrentPage, this.PerPage);

This restricts the number of items shown, but still doesn't change pages when the "CurrentPage" changes.

Is there something missing, what am I doing wrong?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 23-Oct-2004 10:19:39   

Paging is disabled when the page size is 0 or 1. Could you check if the value you pass in for the page size is actually a value > 1 ? Unit tests here show that paging does work, so I have the feeling it might be the page size value you pass into GetMulti() which is the cause of the error.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 37
Joined: 21-Oct-2004
# Posted on: 23-Oct-2004 21:18:50   

Aha! There's the problem, I've been using a page size of 1 for testing.