This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

calling a JS function on mouse event  RSS feed

 
Aparna Ram
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Aparna Ram
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But doesn't the onclick attribute refer to teh left mouse click? I would want one for right mouse click.
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!