calling JS function on an event

Hi,

I would like to call a javascript function that displays a menu, on right 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.

[253 byte] By [aparna_ra] at [2007-11-27 10:56:42]
# 1

You can call JS using the 'onclick' attribute of the JSF component. Every JSF HTML component has it.

BalusCa at 2007-7-29 12:04:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

But doesn't onclick attribute refer to the left-click mouse event?

I would want one for a right-click event.

aparna_ra at 2007-7-29 12:04:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Ah, I overlooked that.

Well, look around in google using the keyword "onrightclick".

BalusCa at 2007-7-29 12:04:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

The only way I could think of doing the same is to extend the Render class of your JSF component and add java script into the same.

Rahul@Suna at 2007-7-29 12:04:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

Hi.. so how exactly does one do that..? I mean, extend the Render class?

aparna_ra at 2007-7-29 12:04:34 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...