Pagination in playframework

I want to implement pagination in Play Frame, is there any tutorial or example for this? I researched the site there and went through the tutorial, but could not implement pagination

thank

+5
source share
2 answers

I have implemented many pages in play!using the pagination Play module . It works great without any problems. I will give you an idea of ​​what I have done below.

First I declare ValuePaginatorwhich points to a result set (in my case a query MYSQL)

ValuePaginator vpaginator=query.resultList();

Then create an instance of Paginator to use it in the view

render(vpaginator);

In the view, I used the following syntax

#{paginate.list items:paginator, as:'r'} 
  <table>
    <tr>
      <td>${r[0]}</td>
      <td>${r[1]}</td>
      <td>${r[2]}</td>
    </tr>
  </table>
#{/paginate.list} 

Suppose my SQL query looks like this:

Select name,id,address from table

r[0] , r[1] id r[2] 3 .

, .

+10
+1

All Articles