You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vijay Kumar <vi...@hotmail.com> on 2002/08/03 10:14:57 UTC

Limiting No of Records per page/view

Hi,
    I am using Struts  . I need to displays say 10 records per page/view and 
give user ability to click on either next button or hyperlink to display 
next set of 10 records. User should also have the ability to go back by 
clicking previous button. I am able to display all records using iterate 
tag, but not able to limit the no of records shown. Any example or code will 
be helpful.
This is what i am doing to display records.

<logic:iterate id="selling" name="table.list">

        <tr>
        <td width="150" height="15" class="tableRowsReadOnly">
       &nbsp<bean:write name="selling" property="sellingcode"/>
        </td>

       <td width="150" height="15" class="tableRowsReadOnly">
       &nbsp<bean:write name="selling" property="season"/>
        </td>

</logic:iterate>

Cheers
vkvk

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Limiting No of Records per page/view

Posted by "Todd G. Nist" <tn...@bellsouth.net>.
Hello Vijay,

You can use the  length and offset attributes of the iterator tag.

The length is used to tell the iterator the number of times/number of items
to retrieve from the collection.

Offset is used to indicate the offset into the collection.

So for example, if you want to display only 10 items of the then you would
do something like this:

	<logic:iterate id="order"
                     name="orderlist"
                     length="10"
                     offset="0">

Hope that helps.

Regards,

Todd G. Nist
-----Original Message-----
From: Vijay Kumar [mailto:vijay_vkvk@hotmail.com]
Sent: Saturday, August 03, 2002 4:15 AM
To: struts-user@jakarta.apache.org
Subject: Limiting No of Records per page/view



Hi,
    I am using Struts  . I need to displays say 10 records per page/view and
give user ability to click on either next button or hyperlink to display
next set of 10 records. User should also have the ability to go back by
clicking previous button. I am able to display all records using iterate
tag, but not able to limit the no of records shown. Any example or code will
be helpful.
This is what i am doing to display records.

<logic:iterate id="selling" name="table.list">

        <tr>
        <td width="150" height="15" class="tableRowsReadOnly">
       &nbsp<bean:write name="selling" property="sellingcode"/>
        </td>

       <td width="150" height="15" class="tableRowsReadOnly">
       &nbsp<bean:write name="selling" property="season"/>
        </td>

</logic:iterate>

Cheers
vkvk

_________________________________________________________________
Join the world�s largest e-mail service with MSN Hotmail.
http://www.hotmail.com


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>