Search code examples
displaytag

Can I customize pagination behavior of displayTag?


I'd like to modify the pagination behavior of displayTag.

Let me explain how it will work.

First, show all first 20 pages in the pagination.

< 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 >

The right arrow above will not go to page 21 (it's not next button) but will show the next set of 20 pages.

< 21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40 >

In summary, the left and right arrow will show next/previous 20 pages, not just next/previous page.

Is it possible to modify something like this?


Solution

  • You can make your own pagination and then to use it like

    <display:setProperty name="paging.banner.full">
       ${yourOwnPagination}
    </display:setProperty>
    

    Maybe you will need to change some other parameters paging.banner... as well.