aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Setting focus to a table row 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 "Setting focus to a table row" Watch "Setting focus to a table row" New topic

Setting focus to a table row

Kalai Selvan
Ranch Hand

Joined: Jul 07, 2004
Posts: 79
Hi all,
How can we move focus to a particular table row/col?

I tried following thing: document.getElementById("someRow").focus(), but its not working.

Please help me out.

Thanks and Regards,
Kalai Selvan T.
Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
I hope by setting focus you mean changing the color of the row.
just set the color of the particular row to what you want .
i cant figure out how else you can say giving focus to the row.

Life called,so here I am.<br />Cheers<br />Niki.:-)
Kalai Selvan
Ranch Hand

Joined: Jul 07, 2004
Posts: 79
Thanks Niki for your quick reply.

But what i am looking at is not highlighting the rows. I want to move the focus to a particular row, so that subsequent key press events will be handled by the row.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376

you would have to give ids to the rows so you know how to locate them.

subject: Setting focus to a table row
Similar Threads
how to move scrollbars dynamically in a scrollpane?
JTable Cell and Tab Problem[jdk1.3 ]
How to set focus on JTable
Row validation in a table
Dynamically Scrolling to the newly added row in HTML table.