I couldn’t find a good set of macros to help navigate through paginated data so I wrote my own. The macro names echo the names of the CakePHP PaginationHelper functions because…well, they’re reasonably sensible.
The macros expect you to add a model attribute called “paginationData” which contains (at least) the following properties:
pageNumber -> The current page number
pageSize -> The number of items in each page
pagesAvailable -> The total number of pages
sortDirection -> The sorting direction (ascending or descending)
sortField -> The field currently sorted by
In my implementation, my paginationData also contains a property called “pageItems” – the actual items in this page.
The macros available to you are:
- first
Outputs a link to the first page - last
Outputs a link to the last page - next
Outputs a link to the next page - previous
Outputs a link to the previous page - numbers
Outputs links to other pages. The macro takes a parameter called “maxPages”, which is the maximum number of pages that should be output. There is also a second parameter “separator”, which is the text/html that should be output between each page link. - page
Outputs a link to a particular page. It takes the page number and link text as parameters. If you omit the link text it’ll default to the page number - counter
Outputs the current page number and the total pages e.g. “1 of 20″ - sort
Outputs a link to sort by a field. Takes the field to sort by as its first parameter. If field is different to the current sort field, the link will change the sort field but not the sort direction. If the field is the same as the current sort field, the link will change the sort direction. The second parameter is the link text, which defaults to the field name with an upper case first letter. It also takes a parameter called “directions”. This is an an array of two items: the words being used in paginationData.sortDirection to describe the sorting direction of ascending or descending. Default: ["Asc", "Desc"]. So it can compare the current sorting direction and switch to the converse.
Note, ordinarily you’ll probably not need to use the “page” macro.
How to use
In Java, add a model attribute “paginationData” containing the properties I’ve described above. Then, in your view, import the library:
<#import "pagination.ftl" as pagination />
Call the macros:
<nav style="float:right;">
<@pagination.first />
<@pagination.previous />
<@pagination.numbers />
<@pagination.next />
<@pagination.last />
</nav>
<@pagination.counter />
Which’ll give you something like:
![]()
For table headings that allow sorting:
<table>
<tr>
<th><@pagination.sort "forename" /></th>
<th><@pagination.sort "surname" /></th>
<th><@pagination.sort "email" /></th>
<th><@pagination.sort "created" "Registration date" /></th>
</tr>
...
</table>
Download
You can download the pagination macros here.
foros de apuestas en directo futbol (http://ofn2.wrendesigned.Com/) deportivas
Juegos online De apuestas reales méxico polonia
circus weddenschappen
Also visit my web page: Mobiel Sporte-Wedden
barcelona psg sitios de apuestas (Kira)
crypto and sports betting (Luisa) sports betting app
new zealandn online casino gaming sites or apps (http://ctracministries.com/)
5 dollar min deposit, free pokie games nz and online casino real money canada,
or new zealandn online gambling pokies
promociones Apuestas En Juegos
barcelona atletico madrid Apuestas Sevilla Valencia (Https://Www.Crewmotion.Es/Info/2026/04/16/Como-Afectan-Las-Lesiones-A-Las-Lineas-De-Apuestas-En-Ncaaf/)
sitios web de Apuestas copa rey
que es hándicap en Calculador De Cuotas Apuestas
pronóstico de apuestas (Ignacio) deportiva
juego juegos en líNea apuestas linea apuestas
casa de apuestas legales (Cathern) con mejores cuotas
juegos de casinos virtuales
My web page; Monte Casino españA
Apuestas pronosticos futbol (http://oscarcarron.es/) madrid borussia
mejores casas canales de Apuestas gratis apuestas tenis
predicciones apuestas deportivas tercera division
mejor casa de apuestas Ganadores eurocopa (http://www.clinicacadizveterinaria.es) para nba
top casas de apuestas Girona, beeconnect.es, peru
casa sistema de apuestas fibonacci, Rhys, apuestas peru online
česká casina s free spiny
Feel free to visit my web-site :: ZahraničNí Casino Vklad Bitcoin (Https://Ecofeed.CO.Ke/)
paginas de Apuestas Con handicap – https://www.centellesclinicadental.es, peru
casas de apuestas fuera de españa (Anglea) venezuela bolivia
qué es un momio en las App apuestas deportivas android
apuestas Android (Feelingmedia.es) mundial de ciclismo
lineas asiaticas apuestas deportivas con bono Gratis
Apuestas Alaves Barcelona nfl
apuestas seguras hoy futbol legales en estados unidos
barcelona atletico de madrid Apuestas Final Libertadores
casas de Apuestas Legales mx deportivas perú
pagina de Atletico Madrid Vs Real Madrid Apuestas peru
como crear un sistema de Bono Sin Deposito Apuestas
que es stake en Apuestas Combinadas Nba deportivas
apuestas roma sevilla (Casademama.es) juego
girona campeon de liga apuestas betis madrid (Myra)
chile app casa De apuestas
casa de barcelona real madrid apuestas sevilla
blog Apuestas Sevilla Celta tenis
que significa stake 100 en apuestas mejor jugador eurocopa [https://Forfebs.Esikanye.Co.za/2022/09/01/diferencias-entre-apuestas-de-baloncesto-en-la-nba-y-la-euroliga/]
casino apuestas online (http://Www.Abogadoscanarias.es) partidos futbol
zahraniční casino Bonus 450 kč (https://zoomslaps.com/online-vyherni-automaty-zdarma-2026/) vklad mobil
peníze zdarma za založení účtu casino
free spiny dnes 2026
Casino Vklad 5 Kč Google Pay vklad 1 kč mobil
apuestas casas de Apuestas para ufc colombia
sistemas bonos casas de apuestas colombia – Elana – apuestas combinadas
Gran Casino Corralejo tomares
bingo
fichas cargadas casino online online bono de bienvenida gratis
wettquoten biathlon
Feel free to visit my blog … basketball pro b wetten [Homer]
ruleta casino minimální vklad 100 kč flexepin ethereum
mobilní online casino s českou licencí 2026 promo kód