Although, you could certainly make your code more optimal I feel though as items like the count etc should be internal to the paginator.
Here's an example:
I would so something like:
class Listings extends DispatchSnippet {
override def dispatch = {
case "list" => list _
case "paginate" => paginator.paginate _
}
val paginator = new MapperPaginatorSnippet(Auction){
override def itemsPerPage = 5
constantParams = OrderBy(Auction.id, Descending) :: Nil
}
def list(xhtml: NodeSeq): NodeSeq =
paginator.page.flatMap(x => bind("x",xhtml, ....)
}
Just some thoughts :-)
Cheers, Tim
On 26 Jul 2010, at 13:53, Lukasz Kuczera wrote:
> I've started new page on wiki about pagination in Lift.
> http://www.assembla.com/wiki/show/liftweb/Pagination
>
> --
> You received this message because you are subscribed to the Google Groups "Lift" group.
> To post to this group, send email to lif...@googlegroups.com.
> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
>
>
Cheers, Tim