Menu

2-Questions on Pagination Functionality

savoym
2007-10-25
2012-10-09
  • savoym

    savoym - 2007-10-25

    I am new to the use of DisplayTag. I am trying to evaluate this product to see if we can use it in the next phase of our project.

    I just downloaded the WAR file and I'm looking specifically at the pagination functionality.

    We have 2 questions:

    1. Is it possible to modify the navigation? To be more specific, instead of having text for the FIRST/PREVIOUS and NEXT/LAST text can we exchange for the following text "<< <" 1, 2, 3, ..."> >>" respectively?

    2. Within the table, is it possible to have 2 lines displayed? In our resultset some of the records may have a DESCRIPTION FIELD that should go on the second line of a record in the table.

    Any help would be greatly appreciated.

    Regards.

     
    • savoym

      savoym - 2007-12-10

      Please disregard my earlier question. With the help of David Friedman from the Stripes group my question has been answered and my problem resolved.

      Regards.

       
    • bego

      bego - 2007-10-29

      Hi!
      to modify the navigation take a llok at the configuration file displaytag.properties. In this file you can change all the text. take a look at this: http://displaytag.sourceforge.net/11/configuration.html

      About displaying 2 lines, you can do it but with jstl help, I mean id you give an identificator to your table, you can access all your fields from that id. I mean if my <display:table id="id" ....
      then I will be able to acess:
      <display:column ...>
      <c:out value="${id.field1}"/>
      <c:out value="${id.field2}"/>
      </display:column>
      I hope this helps you!

       
      • savoym

        savoym - 2007-10-29

        Thanks so much for the response.

         
    • savoym

      savoym - 2007-11-13

      I imported the displaytags.properties file into the WEB-INF/classes directory so that I could modify the text in the paging.banner:

      paging.banner.full=<span class="pagelinks">[<a href="{1}">First</a>/<a href="{2}">Prev</a>] {0} [<a href="{3}">Next</a>/<a href="{4}">Last</a>]</span>

      paging.banner.full=<span class="pagelinks">[<a href="{1}"><<</a>/<a href="{2}"><</a>] {0} [<a href="{3}">></a>/<a href="{4}">>></a>]</span>

      paging.banner.first=<span class="pagelinks">[First/Prev] {0} [<a href="{3}">Next</a>/<a href="{4}">Last</a>]</span>

      paging.banner.last=<span class="pagelinks">[<a href="{1}">First</a>/<a href="{2}">Prev</a>] {0} [Next/Last]</span>

      paging.banner.onepage=<span class="pagelinks">{0}</span>

      However, my problem is when the page first loads it still has the FIRST/PREV text instead of the text and then the 2nd - 3rd page gives me the change I put in the paging.banner.full setting but then on the 4th page it goes back to the NEXT/LAST text again.

      Can someone please tell me what I'm doing wrong. Any help or insight would be greatly appreciated.

      Regards.

       
    • Harun

      Harun - 2007-11-14

      Use properties this way:

      paging.banner.full=<span class="pagelinks">[<a href="{1}"><<</a>/<a href="{2}"><</a>] {0} [<a href="{3}">></a>/<a href="{4}">>></a>]</span>
      paging.banner.first=<span class="pagelinks"> {0} [<a href="{3}">Next</a>/<a href="{4}">Last</a>]</span>
      paging.banner.last=<span class="pagelinks">[<a href="{1}">First</a>/<a href="{2}">Prev</a>] {0} </span>

       
      • savoym

        savoym - 2007-11-14

        Thanks so much for the response. Can you please tell me how I can 'center' the paging:banner as you have denoted above?

        Thanks again for your help.

        Regards.

         
    • savoym

      savoym - 2007-12-06

      I tried asking this question before but I got no response on another thread.

      I thought I'd try it here for a response since I got a response above.

      I am needing to move the display tag properties around on the web form like the following:

      1. X items found, displaying X to X above the display table
        left-justify.

      2. paging.banner.full, paging.banner.first, paging.banner.last
        should be moved above the displaytag table and right-justify.

      3.paging.banner.full, paging.banner.first, paging.banner.last
      should be moved below the displaytag table and centered under the table.

      Questions:

      a. Can I break up the count from the navigation?

      b. If the answer to (a) is YES, is there a way to put the record count LEFT JUSTIFY and the navigation RIGHT JUSTIFY on one <tr></tr>
      and then just put the navigation on the BOTTOM without the record count?

      Any help or direction would be greatly appreciated. THANK YOU!!

       

Log in to post a comment.