Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I need to have result set on a page where the user can sort on the column headers. Any ideas?

column headers ideas page sort user
0
Posted

I need to have result set on a page where the user can sort on the column headers. Any ideas?

0

Author: Poornima Singh (http://www.jguru.com/guru/viewbio.jsp?EID=555639), Nov 21, 2001 I had done the very same thing a couple of weeks back. i had a jsp page which was display the result set and i had to sort by the column header. I had the sql query built in the jsp page on which the selection crietria was done. Here I set the session variable. session.setAttribute(“ssql”,sql); The column Names, had a “href link” with the same request parameter ,but equaled to different Ints and checked the values in the jsp page in a switch case stmt. switch(nsortby) { case 1: { orderby=” order by cum “; break;} case 2: { orderby=” order by ctitle “;break;} case 3: { orderby=” order by cnames “;break;} } Some like this and then , add this string to the SQl string which is in the session with is retirved by, sessSQL=(String)session.getAttribute(“ssql”); And excute it as ususal. It really worked cool with me. All the best !

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123