aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Problem with applying Sql order by   to html table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Problem with applying Sql order by   to html table" Watch "Problem with applying Sql order by   to html table" New topic
Author

Problem with applying Sql order by to html table

sirisha makkapati
Ranch Hand

Joined: Dec 10, 2006
Posts: 83
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

Joined: Feb 26, 2005
Posts: 2053
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

Joined: Dec 10, 2006
Posts: 83
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30293
    
150

It sounds like you have an HTML question. I'll move this to our HTML forum for you.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 460
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.


Visit my blog: http://jnassef.blogspot.com/
Bryce Martin
Ranch Hand

Joined: Nov 19, 2007
Posts: 269
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with applying Sql order by to html table