Well, if you're connected to a database, you can put in the
corresponding table name and sort on that column. The link in the table
header would have something like this in the URL:
MyPage.jsp?sort=UserName


...and then your SQL would say:
sSQL += "SELECT col1,col2,col3,UserName,Address \n";
sSQL += "FROM mytable \n";
sSQL += "ORDER BY " + request.getParameter("sSQL") + "\n";

thanks!

~ Troy Campano ~


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED] On Behalf Of Renato Eschini
Sent: Tuesday, December 23, 2003 6:20 AM
To: [EMAIL PROTECTED]
Subject: Sorting column in a html table

Some one know a pattern or mecchanism for sorting column in a html
table?
By for example clicking in a header of column sorting ascending and
discending..
Thanks all

Ciao e buon lavoro,
         Renato
--------------------------------------------------------
Renato Eschini

   Synapsis S.r.l.
      in Computer Science

   P.zza Dante, 19/20
   57121 Livorno Italy
   tel: +39 0586 426790
   fax: +39 0586 443954
   web: www.websynapsis.com

========================================================================
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to