wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes HTML Table events? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "HTML Table events?" Watch "HTML Table events?" New topic
Author

HTML Table events?

Kiran Jakkula
Greenhorn

Joined: Aug 04, 2010
Posts: 7
Hi,

I need to implement the following requirement:

There will be a popup which will be displayed on clicking a button. On the popup(layover) there will be a table (containing list of details). The user should be able to use the arrow keys to navigate the list (table) and be able to select a row when enter is pressed.

This is very similar to a drop down where the user can navigate through with arrows and select an option. But i cannot use a drop down.....as the table contains multiple columns. How can this be done?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

Where is your code? What specific problems are you having?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
John Eipe
Ranch Hand

Joined: May 23, 2008
Posts: 215
You could use links for each entry in the table. Here is sample code.


PS: I haven't tried this before!

Regards,
John Eipe


www.cs-repository.info
Kiran Jakkula
Greenhorn

Joined: Aug 04, 2010
Posts: 7
Bear Bibeault wrote:Where is your code? What specific problems are you having?



Here's the code snippet



For some reason the onKeyPressEvent just doesn't fire when i press the up and down arrow keys. What could be the problem?
John Eipe
Ranch Hand

Joined: May 23, 2008
Posts: 215
If your requirement is to just trigger those events then place the below code within BODY tag.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
http://www.coderanch.com/t/121703/HTML-JavaScript/Key-Press-select-row-table
 
Consider Paul's rocket mass heater.
 
subject: HTML Table events?