Hi To All,

I am having table,I am doing the sorting for this table using sql query order by.

I have the code when i click on radi button with value="1",it is soring the table by ascending,and if click on the radio button with value="2",
it is sorting in descending order.

I want the code like,If i click on the arrow,Sorting should happen.Like if the records are in ascending order arow should be up and if i click on descending order arow should be down.


can any body give me the idea.

My code is as follows.


<table>
<th>
<td >TestCase Name
<select name="<%= TestCasesData.SORT_BY%>0">
<option value="1" <%= (filterObject.getSortBy1()==1)? "selected":"" %>>TestCase Name</option>
<input type="radio" name="<%= TestCasesData.RADIO %>0" value="1" <%= (filterObject.getAscDesc1()== 1)? "checked":"" %>>asc
<input type="radio" name="<%= TestCasesData.RADIO %>0" value="2" <%= (filterObject.getAscDesc1()== 2)? "checked":"" %>>desc
</td>

<td>Created by
<select name="<%= TestCasesData.SORT_BY%>0">
<option value="1" <%= (filterObject.getSortBy1()==1)? "selected":"" %>>TestCase Name</option>
<input type="radio" name="<%= TestCasesData.RADIO %>0" value="1" <%= (filterObject.getAscDesc1()== 1)? "checked":"" %>>asc
<input type="radio" name="<%= TestCasesData.RADIO %>0" value="2" <%= (filterObject.getAscDesc1()== 2)? "checked":"" %>>desc
</td>
<td>Created Date
<select name="<%= TestCasesData.SORT_BY%>0">
<option value="1" <%= (filterObject.getSortBy1()==1)? "selected":"" %>>TestCase Name</option>
<input type="radio" name="<%= TestCasesData.RADIO %>0" value="1" <%= (filterObject.getAscDesc1()== 1)? "checked":"" %>>asc
<input type="radio" name="<%= TestCasesData.RADIO %>0" value="2" <%= (filterObject.getAscDesc1()== 2)? "checked":"" %>>desc
</td>
</th>
<tr><td>--</td></tr>
<tr><td>--</td></tr>
<tr><td>--</td></tr>

</table>