aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 15629

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.
I agree. Here's the link:
subject: Accessing a dataTable's row in javascript
Similar Threads
JSF to Javascript
radio button using javascript DOM
How to add a Table Row using JS
how to use indexid of logic:iterate tag in struts