• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to Display certain Number of Rows using logic:iterate

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My suggestion would be to research an open source technology like DisplayTag that will do this type of functionality for you.
Hope this helps.
 
A.S. HariLal
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thankyou
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic