| Author |
logic:iterate ..collection data sorting in struts
|
Dattatray Sutar
Ranch Hand
Joined: Jul 12, 2006
Posts: 46
|
|
Hi all.. I m using tomcat , struts. Is there any standard function that sorrts the columnwise data of a perticular collection. e.g. I m using <logic:iterate>...<bean:write>... any parameter that "iterates" through the collection as per the user wants. Thanks a lot.
|
with regards<br />Datta.<br /> <br />To the world you might be one person, but to one person you just might be the world !
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
Here are some options: 1-Sort the list using the Collections.sort() method in your action class prior to displaying the JSP.This link shows an example of how to do this. 2-If the list is being created from a database, use the "order by" clause in your SQL to see that the rows are retrieved in the order you want. 3-Use one of the many JavaScript packages that create a sortable HTML table. These packages will usually allow you to sort by any column by clicking on the column header.
|
Merrill
Consultant, Sima Solutions
|
 |
Dattatray Sutar
Ranch Hand
Joined: Jul 12, 2006
Posts: 46
|
|
Originally posted by Merrill Higginson: Here are some options: 1-Sort the list using the Collections.sort() method in your action class prior to displaying the JSP. This link shows an example of how to do this. 2-If the list is being created from a database, use the "order by" clause in your SQL to see that the rows are retrieved in the order you want. 3-Use one of the many JavaScript packages that create a sortable HTML table. These packages will usually allow you to sort by any column by clicking on the column header.
Thanks a lot for the help..it pointed me in the right direction.
|
 |
 |
|
|
subject: logic:iterate ..collection data sorting in struts
|
|
|