I found the solution using cacheEvents();

Like this:

        function adicionarLegenda($legendas){

                $this->Javascript->cacheEvents();

                foreach ( $legendas as $id => $texto ) {

                        $this->Javascript->event($id, "mouseover", 
"legenda('".$texto."')",
false);
                        $this->Javascript->event($id, "mouseout", "UnTip()", 
false);
                }

                $saida = $this->output($this->Javascript->getCache());
                return $this->Javascript->codeBlock($saida);

        }

On 14 abr, 11:04, Celso <[email protected]> wrote:
> How is the right way?
>
>         $script = $javascript->event($id, "mouseover", "legenda('".
> $texto."')", false).
>         $javascript->event($id, "mouseout", "UnTip()", false);
>
>         echo $javascript->codeBlock($script,null);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to