Wiki - Pagination

47 views
Skip to first unread message

Lukasz Kuczera

unread,
Jul 26, 2010, 8:53:20 AM7/26/10
to Lift
I've started new page on wiki about pagination in Lift.
http://www.assembla.com/wiki/show/liftweb/Pagination

Timothy Perrett

unread,
Jul 26, 2010, 9:20:05 AM7/26/10
to lif...@googlegroups.com
Thanks for contributing :-)

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:

http://github.com/timperrett/lift-in-action/blob/master/chapter-five/src/main/scala/example/travel/snippet/Listings.scala

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.
>
>

Lukasz Kuczera

unread,
Jul 26, 2010, 10:16:53 AM7/26/10
to Lift
Thanks for thoughts and actually for PaginatorSnippet ;)
This code just works and is simple :)
If I find time I will update wiki.

On 26 Lip, 15:20, Timothy Perrett <timo...@getintheloop.eu> wrote:
> Thanks for contributing :-)
>
> 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:
>
> http://github.com/timperrett/lift-in-action/blob/master/chapter-five/...

Timothy Perrett

unread,
Jul 26, 2010, 10:22:32 AM7/26/10
to lif...@googlegroups.com
Please update the wiki - I would rather not have inaccurate information out there if possible.

Cheers, Tim

Lukasz Kuczera

unread,
Jul 26, 2010, 3:34:44 PM7/26/10
to Lift
Tim it seems to me that PaginatorSnippet shall be @depracated then or
I don't catch its purpose.
Reply all
Reply to author
Forward
0 new messages