You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Nebinger, David" <dn...@tbbgl.com> on 2006/11/01 16:35:57 UTC

rowClasses is cool, but how to handle javascript events?

Okay, I'm using rowClasses with two different styles for the rows.  However, I'd like to implement a highlighting scheme based upon onmouseover and onmouseout.

onmouseover is easy enough, simple javascript to set the class to the class that handles the highlight.

The onmouseout is the tough one though.  Ideally it should be as simple as using javascript to set the class to the appropriate row class.  If I were generating the HTML directly I could easily determine which row I'm on and use the appropriate class for the row.

Anyone have some suggestions as to how I would do that in JSF?

Thanks!

Re: rowClasses is cool, but how to handle javascript events?

Posted by Andrew Robinson <an...@gmail.com>.
the following should work:

onmouseover="this.oldClass=this.style.className; this.style.className='over'"
onmouseout="this.style.className=this.oldClass"

On 11/1/06, Nebinger, David <dn...@tbbgl.com> wrote:
> Okay, I'm using rowClasses with two different styles for the rows.  However, I'd like to implement a highlighting scheme based upon onmouseover and onmouseout.
>
> onmouseover is easy enough, simple javascript to set the class to the class that handles the highlight.
>
> The onmouseout is the tough one though.  Ideally it should be as simple as using javascript to set the class to the appropriate row class.  If I were generating the HTML directly I could easily determine which row I'm on and use the appropriate class for the row.
>
> Anyone have some suggestions as to how I would do that in JSF?
>
> Thanks!
>

Re: rowClasses is cool, but how to handle javascript events?

Posted by Jonathan Harley <jo...@parkplatz.net>.
Julian Ray wrote:
> Why not simply store the current background color in the onmouseover event
> and replace it in the onmouseout event?

Why not just use the :hover CSS selector? Even IE7 supports it.


Jonathan.
-- 
.....................................................................
           Dr Jonathan Harley   .
                                .   Email: jon@parkplatz.net
            Zac Parkplatz Ltd   .   Office Telephone: 024 7633 1375
            www.parkplatz.net   .   Mobile: 079 4116 0423

RE: rowClasses is cool, but how to handle javascript events?

Posted by Julian Ray <ju...@yahoo.com>.
Why not simply store the current background color in the onmouseover event
and replace it in the onmouseout event?
 

-----Original Message-----
From: Nebinger, David [mailto:dnebinger@tbbgl.com] 
Sent: Wednesday, November 01, 2006 10:36 AM
To: MyFaces Discussion
Subject: rowClasses is cool, but how to handle javascript events?

Okay, I'm using rowClasses with two different styles for the rows.  However,
I'd like to implement a highlighting scheme based upon onmouseover and
onmouseout.

onmouseover is easy enough, simple javascript to set the class to the class
that handles the highlight.

The onmouseout is the tough one though.  Ideally it should be as simple as
using javascript to set the class to the appropriate row class.  If I were
generating the HTML directly I could easily determine which row I'm on and
use the appropriate class for the row.

Anyone have some suggestions as to how I would do that in JSF?

Thanks!