aspose file tools*
The moose likes Struts and the fly likes How to Display certain Number of Rows using logic:iterate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to Display certain Number of Rows using logic:iterate" Watch "How to Display certain Number of Rows using logic:iterate" New topic
Author

How to Display certain Number of Rows using logic:iterate

A.S. HariLal
Ranch Hand

Joined: Oct 24, 2007
Posts: 31
Hai Dear Friends,
I am new to this group and new to Struts Tecnology. Now I am face a problem during the listing process using logic Iterate. I have a huge amount of records in my database. But I want to display only 5 rows in my list at a time. And other records(rows) can be accessed by clicking the link like (1,2,3.....)(that just seen in a search engine like Google).
can any one kindly help me to find a solution for this.......
The Following Is the code that I used for creating the dynamic List. It works properely for me. In this what should be added to satisfy my new requirment


<logic resent name="listArray">
<logic:notEmpty name="listArray">
<logic:iterate id="myTestForm" name="listArray" scope="request" type="something.*.MyTest">
<tr class="row1">
<td align="center" ><html:multibox property="multiBox"
value="<%=String.valueOf(myTestForm.getUserId())%>" /></td>
<td align="center" ><a href='MyTest.do?uid=<bean:write name="myTestForm" property="userId" filter="true"/<bean:write name="myTestForm" property="name" filter="true" /></a></td>
<td align="center" ><bean:write name="myTestForm" property="description" filter="true" /></td>
</tr>
</logic:iterate>
</logic:notEmpty>
</logic resent>


Thanks in Advance,
ashl
[ October 24, 2007: Message edited by: Harilal A.S ]
John Melton
Ranch Hand

Joined: Aug 17, 2004
Posts: 49
My suggestion would be to research an open source technology like DisplayTag that will do this type of functionality for you.
Hope this helps.


[url]www.jtmelton.com[/url]
A.S. HariLal
Ranch Hand

Joined: Oct 24, 2007
Posts: 31
Thankyou
Vikas
Ranch Hand

Joined: Dec 16, 2004
Posts: 63
Use

<logic:iterate id="myTestForm" name="listArray" scope="request" type="something.*.MyTest" indexId=�index�>

Whereby, you can track the indexId of each iteration and control the number of items to be displayed in list.

Hope this helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Display certain Number of Rows using logic:iterate
 
Similar Threads
How to display 5 rows per page in dynamic listing
drop down list: on refresh page by default select option is not coming
Show - Hide Functionality
how to handle multiple iterates for the code
logic:present not working??????