This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes What Row am I on? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "What Row am I on?" Watch "What Row am I on?" New topic
Author

What Row am I on?

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
If I use JSPL to fill in a table and I give each row a unique id. If I click in a cell is there a way to tell what the row id is?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Easiest solution is to add onclick handler to the cell.

<td id="foo" onclick="alert(this.id)">

Eric
[ September 27, 2007: Message edited by: Eric Pascarello ]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
My idea is to have a checkbox in the first column. If it is clicked I want to turn that row yellow. If unchecked turn it back to white. Can you help me with this.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You are lucky I am waiting on a build:



Eric
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
Thanks a lot. Due lack of knowledge I was trying to complicate it too much.
I hope you have time for one more issue. I need the contents of each cell on the row when I click the checkbox. Can this be done?
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
Hey, I figured it out. Again I was using to much code to try an qualify the cell.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Just for kicks


Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What Row am I on?
 
Similar Threads
About the table record in the database.
How to take up the deleted record id number by the successor record id number?
How to override table and apply style .
Hql delete syntax?
row id to display tag