aspose file tools*
The moose likes JSF and the fly likes calling a JS function on mouse event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "calling a JS function on mouse event" Watch "calling a JS function on mouse event" New topic
Author

calling a JS function on mouse event

Aparna Ram
Ranch Hand

Joined: Jan 27, 2006
Posts: 59
Hi,

I would like to call a javascript function that displays a menu, on right mouse clicking on the editable fields in the jsp page.(input fields)
I use JSF components.

How should I go about for the same?

Many thanks in advance.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

You write it the exact same way if you weren't using JSF, in the tag add an on click="myjavascriptfunction", or something like that, I don't have the "on click" attributes memorized.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Aparna Ram
Ranch Hand

Joined: Jan 27, 2006
Posts: 59
But doesn't the onclick attribute refer to teh left mouse click? I would want one for right mouse click.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Originally posted by Aparna Ram:
But doesn't the onclick attribute refer to teh left mouse click? I would want one for right mouse click.


Read the last part of my post, I wrote, I don't have them memorized, so left right mouse click no different to me in my head, they are just different attributes, I used on click because that is the only one in my head I can remember, but of course it is not for right clicking. But it doesn't matter that you are using JSF because it is not related.

Mark
 
wood burning stoves
 
subject: calling a JS function on mouse event