Hi Patrick,

I use the javascript I send you below, hope it helps.

I know there is a MyFaces Extension that let you
set the onmouseover event for rows, but I don't
remember the exact name.

dt-row-hover  -> is my CSS class for highlighting a row.
comp          -> is the table row, or whatever component you like

I am not a javascript expert, but I may say a dummy 
javascript user, so I won't be able to help you much more.

Hope it helps as it is, it works for me.
Tonio.

//------------------------------------------------------------------
// Provide hover and click effect to entire table rows.
// Usage:
// <table class="grid">
//   <tr href="somelink.jsp" onmouseover="rowHover(this)">
//   ...
//-----------------------------------------------------------------

function rowHover(comp)
{
  comp.oldClassName = comp.className;
  comp.className = 'dt-row-hover';
  comp.onmouseout = function() {
          this.className = this.oldClassName;
  }
}


On Mon, 2006-07-24 at 21:43 +0000, rahmoune patrick wrote:
> Hi all,
>  
> I'm facing a problem with t:dataTable and highlighting
>  
> I have a t:dataTable with
> rowClasses="standardTable_Row1,standardTable_Row2" and would like to
> add highlighting
> when the mouse goes over every row. 
>  
> My first idea was to add some javascript on the onMouseOver/onMouseOut
> that changes the css class. 
>  
> The pb in that I'm unable to restaure the old css class.
>  
> Another bad idea was to find a place to store the old css class name 
>  
> Something like 
>  
> rowOnMouseOver="this.title = this.className;
> this.className='highlighted';"
> rowOnMouseOut="this.className = this.title;"
>  
> It works but a tooltip is displayed with the css class name :-).
>  
> Does someone have this problem? Do I have to store this in something
> like a hashmap index by the TR, or an array with index? How to
> generate the index?
>  
> Thank you for any help.
>  
> patrick
>  

Reply via email to