<h:outputLink value="#" onclick="foo('#{node.id}'); return false;">
 <h:outputText value="#{myValue}" />
</h:outputLink>

On 6/1/07, Lars Hagrot <[EMAIL PROTECTED]> wrote:


I am using the Tomahawk tree2 component and do not want any server requests
when the user clicks on a node. Instead I want to call a javascript method.

Is it possible to declare a commandLink that does not resultat in a form
submit but a
href="javascript:foo(param);" ?

Currently I am using a very ugly solution with   the verbatim tag in
combination with a <a>-tag like

<f:verbatim>
    <a href="javascript:foo(</f:verbatim>)<h:outputText
value="#{node.id}" /><f:verbatim>); "></f:verbatim>
          <h:outputText value="#{myValue}" />
<f:verbatim></a></f:verbatim>

Regards
Lars Hagrot

Reply via email to