The first request is easy, assuming you're using the EL version.

The following code assumes a collection called "someList" is available
in the request.

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"; %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"; %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"; %>

<c:choose>
        <c:when test="${fn:length(someList) > 10}">
                <c:set var="pagesize" value='pagesize='10'"/>
        </c:when>
        <c:otherwise>
                <c:set var="pagesize" value=""/>
        </c:otherwise>
</c:choose>
<display:table uid='list' name='${someList}' ${pagesize}>
        <display:setProperty name='css.tr.even' value='data_even'/>
        <display:setProperty name='css.tr.odd' value='data_odd'/>
        <display:column headerClass='data' class='data_left'
title='Label'
                property='label'/>
        <display:column headerClass='data' class='data_left'
title='col1'>
                <fmt:formatDate value='${list.date}'
pattern='MM/dd/yyyy'/>
        </display:column>
        <display:column headerClass='data' class='data_right'
title='Link'
                property='link'/>
</display:table>

I'll leave the other two to others on the list...

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jon
Wilmoth
Sent: Wednesday, March 14, 2007 9:38 PM
To: displaytag-user@lists.sourceforge.net
Subject: [displaytag-user] Controlling paging display

I'm curious if there's a way to control the "paging" html that is
generated when the table.pagesize attribute is set. Specifically, I'd
like to do a couple of things:

1) When all the results fit on one page, I'd like to hide the paging.
For example if my table has a pagesize of 20 and there are two rows.
Displaytag currently generates the following:  "2 items found,
displaying all items.1".  I'd like to hide the "1." portion.

2) I'd like to be able to position the paging html.

3) I'd like to control the text of the paging info displayed.  For
instance instead of "2 items found, displaying 1 to 1.[First/Prev] 1, 2
[Next/Last]" maybe "2 items found, displaying 1 to 1. [First Page/Prev
Page] 1, 2 [Next Page/Last Page]" or splitting the navigation from the
results summary like so "<tr><td>2 items found, displaying 1 to
1.</td><td>[First/Prev] 1, 2 [Next/Last]</td></tr>"

Thanks,
Jon

------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to