How do i sort database columns in Jsp with Functional Keys?

hi all,
          i would like to know how to sort database columns in jsp using funcitonal keys.
Please find my code as below
<%
        customerlist=new CustomerList();
        customers=new Vector();
        customers=customerlist.getCustomerList(supplier_id);
        int indx=0;
   %>
    <%for (Iterator iter = customers.iterator(); iter.hasNext();) {
        customerlist=(CustomerList) iter.next();
         if (customerlist !=null)
            {
              indx++;
    
            
             %>
                <tr>
	       	<td width='5%'   align='center' bgcolor="<%=tdDataColor%>"><font face='Arial' size="1"><%=(customerlist.getOrder_issue_dt() == null? "":customerlist.getOrder_issue_dt())%></font></td>
		<td width='5%'   align='center' bgcolor="<%=tdDataColor%>"><font face='Arial' size="1"><%=(customerlist.getOrder_send_dt() == null? "": customerlist.getOrder_send_dt())%></font></td>
		 <%}%>
                  
		 </tr>
                 
             <% 
            }
        }%>

Open in new window

saleemkhanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gibu GeorgeChief Technology OfficerCommented:
What do you mean by  funcitonal keys?
0
saleemkhanAuthor Commented:
Hi,
  I mean when press f1 key ,f2 ..... keys on the key board.

i.e when i press f1 key i should sory the below
<td width='5%'   align='center' bgcolor="<%=tdDataColor%>"><font face='Arial' size="1"><%=(customerlist.getOrder_issue_dt() == null? "":customerlist.getOrder_issue_dt())%></font></td>

if press  f2 key

<td width='5%'   align='center' bgcolor="<%=tdDataColor%>"><font face='Arial' size="1"><%=(customerlist.getOrder_send_dt() == null? "": customerlist.getOrder_send_dt())%></font></td>
       <%}%>
                 


...etc
0
Gibu GeorgeChief Technology OfficerCommented:
The key code for F1 and F2 keys are 112 and 113, also if you are going to use it make sure that
document.defaultAction  is set to false other wise the F1 key will open the help window as it is the default action for F1. To sort you need to send a flag as to which column needs to be sorted and in whihc order  and use ajax to refresh without sending the entire page to the server side.
To the issues related to using keypress  related events see this link

http://www.quirksmode.org/js/keys.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.