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.
https://bbs.mmxdm.xyz/?7186
il gladiatore delle i migliori siti scommesse
roulette guaranteed profit
Feel free to visit my web page … casino ohne 1 Euro limit erfahrungen
sisal comparatore bonus scommesse – Wilhemina,
sportive
https://foodiescancook.com/author/interfaceskii660/
Thanks for this excellent article. One more thing to mention is that almost all digital cameras are available equipped with some sort of zoom lens that permits more or less of that scene for being included by way of ‘zooming’ in and out. These kind of changes in {focus|focusing|concentration|target|the a**** length will be reflected inside viewfinder and on massive display screen at the back of your camera.
pronostici Scommesse Sportive sisal (Boatsibzstg.Wpengine.com)
miglior sito
https://www.mech.vg/gateway.php?url=poppersnow.ru
https://espartinas.org/author/conductfda7215/
https://www.mech.vg/gateway.php?url=poppersnow.ru
come vincere alle scommesse (https://Frontwerx.com/) vincitore
giro d italia
https://espartinas.org/author/conductfda7215/
https://forums.maxperformanceinc.com/forums/member.php?u=239463
https://espartinas.org/author/conductfda7215/
previsioni Conviene aprire un centro scommesse
App Scommesse Sportive atalanta
fiorentina
https://www.mapleprimes.com/users/aliciagreen2
scommesse 2026 pronostici sportive
sisal
https://www.mapleprimes.com/users/aliciagreen2
https://josvasmouau.com/author/timgto7041/
siti pronostici sportivi
Check out my web page; scommesse Torino
chukchansi casino reopen, best online casino new zealand
wise gamblers and free usa cash bingo, or new zealandn online
casino pokies
Feel free to visit my website :: dice Gambling game rules
https://www.mapleprimes.com/users/aliciagreen2
list of united statesn online casinos, in casino in usa and usa online casino no deposit bonus codes, or canada online
slots
Feel free to visit my web site … craps $10 minimum (Dennis)
https://josvasmouau.com/author/timgto7041/
centro Punto Scommesse App vicino a me
safe online poker sites united states, online trusted casino usa and united statesn gambling legislation, or free spins on signup
no deposit uk
Here is my web-site; roulette wheel odds calculator
usa gambling websites, united statesn casino online
and online casino groups usa, or best online casino to win money united kingdom
Here is my site; does china have casinos
http://trishaoconnor.com/author/managerhb538/
https://bbs.lotsmall.cn/home.php?mod=space&uid=473575
http://trishaoconnor.com/author/managerhb538/
https://Timelessproperties.net/author/promoqmo90/
miglior Scommesse europei italiano
https://logicmastersindia.com/forum/view-profile.asp?action=view&uid=38515
https://logicmastersindia.com/forum/view-profile.asp?action=view&uid=38515
scommesse superbowl
venezia
https://Timelessproperties.net/author/promoqmo90/
https://Timelessproperties.net/author/promoqmo90/
https://linkmix.co/51147210
canali telegram Pronostici Scommesse Scudetto
https://russasnet.com.br/author/hungarianbgn4392/
https://linkmix.co/51147210
https://justpaste.me/vMp83/a
https://justpaste.me/vMp83/a
https://justpaste.me/vMp83/a
big usa poker tournaments, top 20 online casinos
uk no deposit and new casino No deposit Needed
online real money australia, or best real money poker
app usa
http://drrock.com/author/demonstrateszpe7624/
bonus scommesse in tempo reale (https://www.Wordscheat.com) deposito
scommesse freccette
Feel free to surf to my blog post; online Pronostici 2026 coppa Italia
ios Di scommesse in Italia skrill