Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sorting the fields of a table

 
bobby chaurasia
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
bobby chaurasia
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steve,I did have a look I guess what I am looking for is achieving this using the struts custom tags. Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic