You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Lars Hagrot <La...@signifikant.se> on 2007/06/01 08:39:11 UTC
Link within a tree2 without a submit?
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
Re: Link within a tree2 without a submit?
Posted by Andrew Robinson <an...@gmail.com>.
<h:outputLink value="#" onclick="foo('#{node.id}'); return false;">
<h:outputText value="#{myValue}" />
</h:outputLink>
On 6/1/07, Lars Hagrot <La...@signifikant.se> 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