1

Is there a way to show the last page in the pagination bar using using Display Tag library? I got 3 pages but on the first page it shows 1 of 2 and I want to show 1 of 3 then 2 of 3 and finally 3 of 3. Below is the current format I am using.

<display:setProperty name="paging.banner.first" value='<span class="pagelinks"> |< << | Page {0} <a href="{2}"> | >> </a><a href="{4}">>|</a></span>'/>
<display:setProperty name="paging.banner.last" value='<span class="pagelinks"> <a href="{1}">|< </a> <a href="{2}"> << | Page </a> {0} | >> >| </span>'/> 
<display:setProperty name="paging.banner.full" value='<span class="pagelinks"> <a href="{1}">|< </a> <a href="{2}"> << | Page </a> {0}<a href="{3}"> | >> </a><a href="{6}">>| </a></span>'/>

If I change {4} in the first link it doesn't display anything. Please let me know how can I achieve this.

This is how it shows up:

enter image description here

Thanks.

Mike
  • 777
  • 3
  • 16
  • 41

1 Answers1

1

Alright guys, I figured it out. I am amazed I didn't receive a single comment. Anyways. Below code shows the pagination bar like this: if there are total of 4 pages it will display it Page 1 of 2, Page 2 of 4, Page 3 of 4 finally Page 4 of 4 in display tag.

<display:setProperty name="paging.banner.full" value='<span class="pagelinks"> <a href="{1}">|< </a> <a href="{2}"> << </a> | Page {5} of {6} <a href="{3}"> | >> </a><a href="{4}">>| </a></span>'/>
<display:setProperty name="paging.banner.first" value='<span class="pagelinks"> |< << | Page {5} of {6} <a href="{3}"> | >> </a><a href="{4}">>|</a></span>'/>
<display:setProperty name="paging.banner.last" value='<span class="pagelinks"> <a href="{1}">|< </a> <a href="{2}"> << | Page {5} of {6} </a>  | >> >| </span>'/>

enter image description here

I hope this helps.

Mike
  • 777
  • 3
  • 16
  • 41