File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Sorting the fields of a table 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 "Sorting the fields of a table " Watch "Sorting the fields of a table " New topic
Author

Sorting the fields of a table

bobby chaurasia
Ranch Hand

Joined: Mar 30, 2002
Posts: 84
I'm using struts framwork. The data for populating the table is fed from the database using jdbc. The output is displayed in the table.
The format is something like this
-------------------------------------------------------------
S.No | Date | Amount | Details |
-------------------------------------------------------------
1 | 20.02.2003 | 100 | abc |
-------------------------------------------------------------|
I'm able to display the details in the table. I need to incorporate the
functionality where in if the user clicks on Date or Amount ( which are displayed as a link ), the application should sort the rows in acending order. Also I want to display only 10 entries per page and provide
1 2 3 4 ( pages link) so that once the user clicks on these the next 10 entries are displayed.
Thanks in advance
[ December 10, 2003: Message edited by: bobby chaurasia ]
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 852
Check out the FormattedDataSet. It can easily sort columns by clicking them. There is a live demo off of http://www.fdsapi.com that allows you to enter any sql and have it display as a sortable HTML table with clickable column headers.


http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
bobby chaurasia
Ranch Hand

Joined: Mar 30, 2002
Posts: 84
Thanks Steve,I did have a look I guess what I am looking for is achieving this using the struts custom tags. Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sorting the fields of a table
 
Similar Threads
jsp
Simple list table
Jsp Paging
how to create a table.
JSF: Need advice on acheiving specific funcationality