You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Hubert Rabago <hr...@gmail.com> on 2004/10/12 14:35:22 UTC

Re: iterate indexId (was: iterate paging)

See http://struts.apache.org/faqs/indexedprops.html#dynamicindexes


On 12 Oct 2004 16:13:43 +0800, Sebastian Ho
<se...@bii.a-star.edu.sg> wrote:
> Does anyone has an example using struts iterate? How does indexId works?
> 
> Sebastian
> 
> 
> 
> 
> On Sat, 2004-10-09 at 01:05, Bill Siggelkow wrote:
> > Or you could do it yourself with JSTL:
> >
> > <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> > <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
> > <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
> > <html>
> > <head>
> >    <title>Paging Example</title>
> > </head>
> > <body>
> >    <jsp:useBean id="pagedData"
> > class="com.oreilly.strutsckbk.ch04.PagedData"/>
> >    <bean:size id="listSize" name="pagedData" property="data"/>
> >    <c:set var="pageSize" value="10"/>
> >    <c:set var="pageBegin" value="${param.pageBegin}"/>
> >    <c:set var="pageEnd" value="${pageBegin + pageSize - 1}"/>
> >    <c:if test="${(pageBegin - pageSize) ge 0}">
> >      <a href='<c:url value="paged_data.jsp">
> >                 <c:param name="pageBegin" value="${pageBegin - pageSize}"/>
> >               </c:url>'>
> >        Prev
> >      </a>
> >    </c:if>
> >    &nbsp;
> >    <c:if test="${(listSize gt pageSize) and (pageEnd lt listSize)}">
> >      <a href='<c:url value="paged_data.jsp">
> >                 <c:param name="pageBegin" value="${pageBegin + pageSize}"/>
> >               </c:url>'>
> >        Next
> >      </a>
> >    </c:if>
> >    <table border="2">
> >      <tr>
> >        <th>First Name</th>
> >        <th>Last Name</th>
> >        <th>Term of Office</th>
> >      </tr>
> >      <c:forEach var="pres" items="${pagedData.data}"
> >               begin="${pageBegin}" end="${pageEnd}">
> >        <tr>
> >          <td>
> >            <c:out value="${pres.firstName}"/>
> >          </td>
> >          <td>
> >            <c:out value="${pres.lastName}"/>
> >          </td>
> >          <td>
> >            <c:out value="${pres.term}"/>
> >          </td>
> >        </tr>
> >      </c:forEach>
> >    </table>
> > </body>
> > </html>
> >
> >
> > Peng Tuck Kwok wrote:
> >
> > > Or you coud use displaytag.
> > >
> > > http://displaytag.sf.net
> > >
> > > It's pretty ok from what I can see.
> > >
> > >
> > >
> > > On Fri, 8 Oct 2004 14:32:58 +0530, Viral_Thakkar
> > > <vi...@infosys.com> wrote:
> > >
> > >>Use ValueListHandler design pattern ..
> > >>
> > >>-----Original Message-----
> > >>From: Sebastian Ho [mailto:sebastianh@bii.a-star.edu.sg]
> > >>Sent: Friday, October 08, 2004 1:21 PM
> > >>To: 'Struts Users Mailing List'
> > >>Subject: iterate paging
> > >>
> > >>hi
> > >>
> > >>anyone has codes on how to display paging?
> > >>i.e. display 10 rows per page with 'next' / 'back' functions.
> > >>
> > >>Thanks
> > >>
> > >>sebastian
> > >>
> > >>---------------------------------------------------------------------
> > >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >>For additional commands, e-mail: user-help@struts.apache.org
> > >>
> > >>---------------------------------------------------------------------
> > >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >>For additional commands, e-mail: user-help@struts.apache.org
> > >>
> > >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org