• Post Reply Bookmark Topic Watch Topic
  • New Topic

server-side sorting of tables  RSS feed

 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to do server side sorting of tables with jsp? I want the user to be able to click a column header and have the page refresh with the apropriate values in place. Ultimately, I also want filters... but that's not a priority
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course it is possible. Just submit the request with column name, sort the the table and return the new sorted table back to the client.
 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I do it through a servlet?
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on your web app architecture, but in general, yes you could do it through servlet. You are not using Struts or any other MVC framework?
 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We may someday start using jsf, but for now I need to just use jsp/servlets
 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I'm going to pass the table data to a backing bean and then do somthing like <%=table.generateHtml()%>. Can you think of a better way?

Thanks for your help so far,
D.P.
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think about custom tag, it should be a better way.
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this
http://displaytag.sourceforge.net/
 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks man
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!