3

I'm trying to style the <displaytag> to obtain something that look great.

The official demo look like :

http://demo.displaytag.org/displaytag-examples-1.2/example-paging.jsp enter image description here

But I obtain only this :

style of my current pagination

How can I change the rendering of the pagination part of the displaytag so that page numbers are in <li> elements ?

Thanks in advance

fluminis
  • 3,575
  • 4
  • 34
  • 47

2 Answers2

2

To customise the pagination, I had to add a displayTag.properties file with the following properties :

paging.banner.no_items_found=<span class="pagebanner">No {0} found.</span>
paging.banner.one_item_found=<span class="pagebanner">One {0} found.</span>
paging.banner.all_items_found=<span class="pagebanner">{0} {1} found, displaying all {2}.</span>
paging.banner.some_items_found=<span class="pagebanner">{0} {1} found, displaying {2} to {3}.</span>

paging.banner.full=<div class="pagination"><ul><li class="prev disabled"><a href="{1}" class="next" title="first"><img src="static/images/first.png" alt="first" /></a></li><li class="prev disabled"><a href="{2}" class="next" title="previous"><img src="static/images/previous.png" alt="previous" /></a></li>{0}<li><a href="{3}" class="next" title="next"><img src="static/images/next.png" alt="next" /></a></li><li class="next"><a href="{4}" class="next" title="lest"><img src="static/images/last.png" alt="last" /></a></li></ul></div>
paging.banner.first=<div class="pagination"><ul><li class="prev"><a href="{1}" class="next" title="first"><img src="static/images/first.png" alt="first" /></a></li><li class="prev"><a href="{2}" class="next" title="previous"><img src="static/images/previous.png" alt="previous" /></a></li>{0}<li><a href="{3}" class="next" title="next"><img src="static/images/next.png" alt="next" /></a></li><li class="next"><a href="{4}" class="next" title="lest"><img src="static/images/last.png" alt="last" /></a></li></ul></div>
paging.banner.last=<div class="pagination"><ul><li class="prev"><a href="{1}" class="next" title="first"><img src="static/images/first.png" alt="first" /></a></li><li class="prev"><a href="{2}" class="next" title="previous"><img src="static/images/previous.png" alt="previous" /></a></li>{0}<li class="next disabled"><a href="{3}" class="next" title="next"><img src="static/images/next.png" alt="next" /></a></li><li class="next disabled"><a href="{4}" class="next" title="lest"><img src="static/images/last.png" alt="last" /></a></li></ul></div>
paging.banner.onepage=<div class="pagination"><ul>{0}</ul></div>

paging.banner.page.selected=<li><strong>{0}</strong></li>
paging.banner.page.link=<li><a href="{1}" title="Go to page {0}">{0}</a></li>
paging.banner.page.separator=
fluminis
  • 3,575
  • 4
  • 34
  • 47
  • hi, i copied this and put it under src folder but still i dont get the UI and get the old one. – Java Questions Nov 21 '14 at 01:41
  • @fluminis, is there a way to shoe the last page number in the pagination bar. like 1 of 10. 10 being the last page number. – Mike May 23 '17 at 20:51
2

In displayTag.properties:

paging.banner.placement=top

paging.banner.onepage=
paging.banner.first=<span class="pagination pagination-right"><ul>{0}<li><a href="{4}"         title="\u00daltima">...{6}</a></li></ul></span>
paging.banner.full=<span class="pagination pagination-right"><ul><li><a href="{1}" title="Primeira">1\u00aa</a></li>{0}<li><a href="{4}" title="\u00daltima">...{6}</a></li></ul></span>
paging.banner.last=<span class="pagination pagination-right"><ul><li><a href="{1}" title="Primeira">1\u00aa</a></li>{0}</ul></span>
paging.banner.page.link=<li><a href="{1}" title="P\u00e1gina {0}">{0}</a></li>
paging.banner.page.selected=<li class="disabled"><span>{0}</span></li>
paging.banner.page.separator=

Another format

More information on http://www.displaytag.org/1.2/configuration.html

Inês Gomes
  • 4,313
  • 1
  • 24
  • 32