myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <>
Subject Re: 'Simulating' commandLink from Javascript
Date Thu, 02 Feb 2006 03:48:07 GMT
Ryan Wynn wrote:
> On 2/1/06, Laurie Harper <> wrote:
>> Hi, I need to do the equivalent of clicking a commandLink in Javascript;
>> in other words, I need to write an onClick handler that does the same
>> thing as clicking on a commandLink would. Is there a standard way to do
>> that? I'm not sure if the JSF spec includes any specifics on client-side
>> APIs.
> I have found that it is different for IE vs. Netscape/Firefox. I'm not
> a js expert but it works.
> This is how I invoke a hidden commandLink in a table row...
> [...]

Thanks for the response, but that's not what I'm trying to do. I don't 
need to locate and invoke an existing command link; I don't have a 
command link to invoke. I need to achieve the same effect as clicking a 
command link would give.

In other words, I need to write a Javascript function which, when 
invoked, does the same thing the onClick handler a commandLink generates 
would do.

The best I can come up with so far is to create a custom component which 
extends HtmlCommandLink and overrides the encode/decode methods, but 
creating a whole new component just to be able to create Javascript 
onClick handlers seems rather excessive.


View raw message