File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes What Row am I on? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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: 1254
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: 15357
    
    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: 1254
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: 15357
    
    6
You are lucky I am waiting on a build:



Eric
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1254
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: 1254
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: 15357
    
    6
Just for kicks


Eric
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: What Row am I on?
 
Similar Threads
About the table record in the database.
row id to display tag
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?