Search code examples
javajspdisplaytag

How to customize the default message of display tag library x items found, displaying 1 to 4...


I am using Display Tag library for some pagination and sorting. So far it is working perfectly fine but I need to change the default message x items found, displaying 1 to 4.. to the screenshot below. I have changed some of the table properties already based on what I need but the one in the screenshot seems a little odd. How can I achieve this in display tag.

enter image description here

code:

<display:table id="data" name="intgList" requestURI="/integration/viewIntegration" class="fieldLabelCell" pagesize="4">
    <!-- Setting table properties -->
    <display:setProperty name="basic.empty.showtable" value="true" />
    <display:setProperty name="paging.banner.placement" value="bottom" />
    <display:setProperty name="paging.banner.no_items_found" value=""></display:setProperty>
    <display:setProperty name="basic.msg.empty_list_row" value=""></display:setProperty>
    <!-- Displaying columns data -->
    <display:column property="lob" title="Line of<br>Business" sortable="true" class="displayColumns" />
    <display:column property="insuredName" title="Insured" sortable="true"  class="displayColumns"/>
    <display:column property="custPhone" title="Customer<br>Phone" sortable="true"  class="displayColumns" />
    <display:column property="policyNumber" title="Policy #" sortable="true" class="displayColumns" />
    <display:column property="createdDate" title="E-Sign<br>Created Date" sortable="true" class="displayColumns" />
    <display:column property="custEmail" title="Customer<br>Email" sortable="true" class="displayColumns" />
    <display:column property="esignNumDocs" title="# of E-Sign Documents" sortable="true" class="displayColumns"  />
</display:table>

Solution

  • I got it working. Here is the solution. The only thing is to add the images instead of hard coded less than and greater than signs. Basically I had to override the table properties. Below is the complete code snippet.

    <display:table id="data" name="intgList" requestURI="/integration/viewIntegration" class="fieldLabelCell" pagesize="2" sort="list">
            <!-- Setting table properties -->
            <display:setProperty name="basic.empty.showtable" value="true" />
            <display:setProperty name="paging.banner.placement" value="top" />
            <display:setProperty name="basic.msg.empty_list_row" value=""></display:setProperty>
            <display:setProperty name="paging.banner.group_size" value="2"></display:setProperty>
            <display:setProperty name="paging.banner.no_items_found" value=""></display:setProperty>
            <display:setProperty name="paging.banner.page.separator" value=" of "></display:setProperty>
            <display:setProperty name="paging.banner.first" value='<span class="pagelinks"> |< << | Page {0}<a href="{3}"> | >> </a><a href="{4}">>|</a></span>'></display:setProperty>
            <display:setProperty name="paging.banner.last" value='<span class="pagelinks"> <a href="{1}">|< </a> <a href="{2}"> << | Page </a> {0} | >> >| </span>'></display:setProperty>
            <display:setProperty name="paging.banner.full" value='<span class="pagelinks"> <a href="{1}">|< </a> <a href="{2}"><<</a> {0}<a href="{3}"> | >> </a><a href="{4}">>| </a></span>'></display:setProperty>
            <!-- Displaying columns data -->
            <display:column property="lob" title="Line of<br>Business" sortable="true" class="displayColumns" />
            <display:column property="insuredName" title="Insured" sortable="true"  class="displayColumns"/>
            <display:column property="custPhone" title="Customer<br>Phone" sortable="true"  class="displayColumns" />
            <display:column property="policyNumber" title="Policy #" sortable="true" class="displayColumns" />
            <display:column property="createdDate" title="E-Sign<br>Created Date" sortable="true" class="displayColumns" />
            <display:column property="custEmail" title="Customer<br>Email" sortable="true" class="displayColumns" />
            <display:column property="esignNumDocs" title="# of E-Sign Documents" class="displayColumns"  />
        </display:table>