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.
bonos gratis jugar black jack en vivo casino online
barcelona
kasyno od 1 zł darmowe spiny
my homepage najlepsze automaty Na prawdziwe pieniądze 2026
http://riotstories.co.uk/author/streampra888/
http://riotstories.co.uk/author/streampra888/
online ruletka 2026
Stop by my web page :: kasyno przelewy24 Opinie
caesars slots juegos de casino para jugar gratis tragamonedas
y varias más (http://Catering.Magillo.pl/) de casino
gratis
https://interestpin.com/user/137998
https://buildingchurch.tv/author/cameroonlfz453/
polskie kasyno online w Polsce ranking 2026 mastercard
https://interestpin.com/user/137998
https://interestpin.com/user/137998
percentuale rosso E nero alla Roulette
https://buildingchurch.tv/author/cameroonlfz453/
Gillian chung sex scandal nude picsThong bikini picturersDick jacking offInvigorating facialWomans bare boobsMojo asian restaurant lancaster paMyfree porn websitesJapanise pornstar
xnxx I saw my neighbors titsFifteen year olds cockFree gay porn storeisNaked women modelsReal housewives
jacqualine escort vegasWet jeans bath lesbiansBig hot nude latinas pics https://go.xvideosway.com/ Cunts fucking good hairy oldWorldsex hardcore college girlsStepo by step deep
throat indtructionsTeen lesbian movies guysAmateur goth girl picsForrbiden pornPlymouth escort services
xnxx Trousers sexyCollege fucking hardcoreNice tight pink pussySuzannah reid
nudeGirls 50 and older sex addictsHow fast does
sperm travelEros hentaiTen sex videosIud vaginal contraceptive ringArtery clearing breakthrough bottom lineNaked
girl 16Marital sex picsNude lesbian meta cafe
https://schoolido.lu/user/madelyn541/
https://schoolido.lu/user/madelyn541/
https://schoolido.lu/user/madelyn541/
https://animeforums.net/profile/78899-madelyn541/
https://www.ruhrpott-poker.de/author/provelkv2883/
https://www.ruhrpott-poker.de/author/provelkv2883/
https://animeforums.net/profile/78899-madelyn541/
https://hutsons-hacks.info/author/campingila0823/
https://animeforums.net/profile/78899-madelyn541/
https://hutsons-hacks.info/author/campingila0823/
https://kaeuchi.jp/forums/users/madelyn541/
https://hutsons-hacks.info/author/campingila0823/
https://kaeuchi.jp/forums/users/madelyn541/
https://kaeuchi.jp/forums/users/madelyn541/
https://www.lemongrovelane.com/author/designedkdr239/
tombola numeri da 1 a 90
My webpage siti per giocare online D’azzardo
https://www.lemongrovelane.com/author/designedkdr239/
https://www.mymeetbook.com/madelyn541
https://www.lemongrovelane.com/author/designedkdr239/
https://www.mymeetbook.com/madelyn541
https://www.mymeetbook.com/madelyn541
http://nancycain.com/author/cardhth26/
https://md.sebastians.dev/s/k30e-DWEg
http://nancycain.com/author/cardhth26/
http://nancycain.com/author/cardhth26/
https://pixelandbloom.com/author/functionouh7611/
Apple Real Money Gaming
pay online casino united kingdom, how many poker machines in australia and
the largest casino in australia, or usa casino no deposit bonus
https://www.ebooklingo.com/profile/16163
uno dadi regole
Take a look at my web-site giochi di Slots
https://www.ebooklingo.com/profile/16163
giocate alla roulette numero gagnant
https://www.ebooklingo.com/profile/16163
https://pixelandbloom.com/author/functionouh7611/
https://pixelandbloom.com/author/functionouh7611/
http://nursesoncall.com/author/improvedpnz962/
https://theresanaiforthat.com/@madelyn541/