myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Lessard" <simon.lessar...@gmail.com>
Subject Re: [Trinidad] Override onclick Event
Date Fri, 21 Dec 2007 12:57:41 GMT
Hi Sven,

Why not use the onclick attribute on the component?


Regards,

~ Simon

On Dec 21, 2007 7:55 AM, Rottstock, Sven <Sven.Rottstock@sungard.de> wrote:

> Hi list,
>
> i have to dynamically override the onclick method. Currently i used the
> following code snippet:
>
> <script>
>  var completeBtn =
> window.document.getElementById("activityPanel:activityActionPane:complet
> e-button");
>  var oldOnClickMethod = null;
>  if(completeBtn != null)
>  {
>    oldOnclickMethod = completeBtn.onclick;
>    completeBtn.onclick = doMyAction;
>  }
>  function doMyAction() {
>     // perform additional tasks here...
>     // ...
>     // ...
>     oldOnClickMethod();
>  }
> </script>
>
> I cannot imagine that this solution is the best way (but it works for
> me)...have anybody a hint for me how i can do that in a "Trinidad way"?
>
> Regards,
>
> Sven
>

Mime
View raw message