File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Accessing a dataTable's row in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Accessing a dataTable Watch "Accessing a dataTable New topic

Accessing a dataTable's row in javascript

Fawad Ali
Ranch Hand

Joined: Dec 28, 2009
Posts: 112
Hello All,
I need to change the color of a row through javascript on mouseover. How can I get the row object of datatable by bringing mouse over the row.

Regards, Fawad Ali.
Software Engineer, Stafona Inc. - My Blog
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961

I'm not sure you need JavaScript to do that. I think CSS alone will handle it. You just need to define an approprate CSS class in the table's rowClasses attribute.

Customer surveys are for companies who didn't pay proper attention to begin with.
Fawad Ali
Ranch Hand

Joined: Dec 28, 2009
Posts: 112
Hello Tim,
Thanks a lot for your reply. You provided a lot of help since I joined. Well I tried a css class but its not working. I tried some thing like this


and in dataTable

<h:dataTable value="#{viewAllInvoicesBean.invoicesList}" var="invoice" rowClasses="blue" >

but its not working. Thats why I asked for javascript access. Besides the hovering feature never works in Internet Explorer, that is why again I am going for javascript access.
wood burning stoves
subject: Accessing a dataTable's row in javascript
Similar Threads
how to use indexid of logic:iterate tag in struts
JSF to Javascript
How to add a Table Row using JS
radio button using javascript DOM