Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with applying Sql order by to html table

 
sirisha makkapati
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all,

I want to aply sql order by commands to html table.

TestCase_asc=select * from mytable order by testcase asc;
TestCase_desc=select * from my tableorder by testcase desc;
user_asc=select * from mytable order by user asc;
user_desc=select * from my tableorder by user desc;


My html table:

TestCase User
test1 ANTONY
Count ZXc
Compare ABC

When user clicks on fields,Records should sort by calling above sql commands.
Any one please give me the code for this.

Thanks in advance
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the problem? Have you coded it already? Any error?

Do you want to sort it without going back to the model/database/server, using javascript? Or you want to go back to re-query against the database?
 
sirisha makkapati
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I already have the code for sorting while clicking the radio buttons as follows.

<td bgcolor="#e1e8f3" align="left">
<input type="radio" name="<%= TestCasesData.RADIO %>0" value="1" >asc
<input type="radio" name="<%= TestCasesData.RADIO %>0" value="2" >desc
</td>



with The above line of code i could able to sort while clicking the radio buttons buti want to sort while clicking the arrow rather than clicking the radio button.


please help me,
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you have an HTML question. I'll move this to our HTML forum for you.
 
Alaa Nassef
Ranch Hand
Posts: 471
Hibernate Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sirisha,

I advice you to use the display tag library. It gives you the ability to have sortable columns, and to sort by clicking on the column header.

I don't know if this is what you want or not. The problem here is that you are not specifying your problem clearly. Please try to be more clear so that I can help you better.
 
Bryce Martin
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to code for the arrow's onClick event just like you did for the radio buttons onClick event. Its essentially the same thing...you just need to apply it to the arrow instead of the button.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic