Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts logic:iterate problem

 
smitha mano
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
list.jsp
<body>
<logic resent name="dList">
<table width="76%" border="0" align="center">
<tr>
<tr>
<td bgcolor="#F2F2F2"><strong>Id</strong></td>
<td bgcolor="#F2F2F2"><strong>Name</strong></td>
<td bgcolor="#F2F2F2"><strong>Qualification</strong></td>
<td bgcolor="#F2F2F2"><strong>Experience</strong></td>
</tr>
</tr>
<logic:iterate name="dList" id="lt">
<tr>
<td><html:link action="myAction.do?action=view&id=${lt.id}">${lt.id}</html:link></td>
<td>${lt.name}</td>
<td>${lt.qual}</td>
<td>${lt.Exp}</td>
</tr>
</logic:iterate>
</table>
</body>

in my list.jsp contian this fields. it displays
as follows design

<table width="34%" border="0" align="center">
<tr>
<td width="6%"><strong> Id</strong></td>
<td width="54%"><strong> Name</strong></td>
<td width="13%"><strong>Qualification</strong></td>
<td width="27%"><strong> Experience</strong></td>
</tr>
<tr>
<td><div align="center">1</a></div></td>
<td>Anu Elias</td>
<td>MCA</td>
<td>4</td>
</tr>
<tr>
<td><div align="center">2</a></div></td>
<td>Martin Kurian</td>
<td>B.Tech</td>
<td>6</td>
</tr>
<tr>
<td><div align="center">3</a></div></td>
<td>Rajesh George</td>
<td>MCA</td>
<td>7</td>
</tr>
<tr>
<td><div align="center">4</a></div></td>
<td>Jacob</td>
<td>Ph.D</td>
<td>8</td>
</tr>
<tr>
<td><div align="center">5</a></div></td>
<td>Feena</td>
<td>BCA</td>
<td>4</td>
</tr>
<tr>
<td><div align="center">6</a></div></td>
<td>Sachit George</td>
<td>M.Phil</td>
<td>4</td>
</tr>
</table>
************************************
but i wanted to display given below and also when i click on the heading like( id, name,qualification,experience ) id it will sort by order
and below the design in table each rows
please help me
<table width="34%" border="0" align="center">
<tr>
<td width="6%"><strong> Id</strong></td>
<td width="54%"><strong> Name</strong></td>
<td width="13%"><strong>Qualification</strong></td>
<td width="27%"><strong> Experience</strong></td>
</tr>
<tr>
<td bgcolor="#F5F5F5"><div align="center">1</a></div></td>
<td bgcolor="#F5F5F5">Anu Elias</td>
<td bgcolor="#F5F5F5">MCA</td>
<td bgcolor="#F5F5F5">4</td>
</tr>
<tr>
<td><div align="center">2</a></div></td>
<td>Martin Kurian</td>
<td>B.Tech</td>
<td>6</td>
</tr>
<tr>
<td bgcolor="#F5F5F5"><div align="center">3</a></div></td>
<td bgcolor="#F5F5F5">Rajesh George</td>
<td bgcolor="#F5F5F5">MCA</td>
<td bgcolor="#F5F5F5">7</td>
</tr>
<tr>
<td><div align="center">4</a></div></td>
<td>Jacob</td>
<td>Ph.D</td>
<td>8</td>
</tr>
<tr>
<td bgcolor="#F5F5F5"><div align="center">5</a></div></td>
<td bgcolor="#F5F5F5">Feena</td>
<td bgcolor="#F5F5F5">BCA</td>
<td bgcolor="#F5F5F5">4</td>
</tr>
<tr>
<td><div align="center">6</a></div></td>
<td>Sachit George</td>
<td>M.Phil</td>
<td>4</td>
</tr>
</table>
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to check this tag library:

http://displaytag.sourceforge.net/

HTH
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic