1) Have you heard of Tiles?  This an extension to the Struts' template tag.
With Tiles you can just create a layout that 
will interate to your collection and insert a tile at a time, in this case
it will be your table's row, and passing in 
a list of component context data, that is your colum data so that each tile
being insterted can display your table data.

2) Sorting can be done by having multiple sorted set view of your collection
data.  And by using Tiles you can pass in the correct sorted collection so
the layout can display.

--Danny
-----Original Message-----
From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 26, 2001 9:51 PM
To: Struts-User (E-mail)
Subject: Usage to Table with struts


Hello All,

I have 2 questions regarding the display of a html table when using struts.

1. Is there a table tag library with struts. currently I am rendering the
table my means of a scriptlet.
something like

<%
        Collection col = (Collection) session.getAttribute("list");
        for(Interator i = col.iterator(); i.hasNext();) {
                %>
                        <tr>
                                <td> </td>
                        </tr>
                <%

        }
%>

Is this the correct way of rendering a table with struts (I wish not to use
scriptlets as far as possible.)

2. I want to let the user sort the table also, based on each column.
The question is that do I have to write a separate action class for each
sort?

is there a simpler way of giving the user the ability to sort the table
based
on each column of the table.

Thanks in advance for your help.

regards,
Abhishek.


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to