O'Reilly logo

Lift Application Development Cookbook by Gilberto T. Garcia Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Paginating result sets

Sometimes, we need to deal with so much data that presenting them at once to the user is not an option. The reasons are as follows:

  • It will consume too many resources
  • It will be slow to render the page to the user
  • The user is probably not interested in all the data but just a small part of it

This is why we paginate result sets, to make the user's life easier.

In this section, we will see how to paginate a page using another built-in feature from Lift.

Getting ready

We will use the project from the previous recipe. You can duplicate it or modify the same project.

How to do it...

Carry out the following steps to paginate result sets:

  1. In the Contacts snippet, add the following import statements:
    import net.liftweb.http.PaginatorSnippet ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required