Hi Alberto,
I think a more elegant solution is being worked out in 2.0, but for now I've
been doing something like this:

public class MyJavascriptGizmo extends AbstractBehavior {

   public void bind (Component component)
   {
       component.getWebPage
().getBodyContainer().addOnLoadModifier(getScript());
   }

   public void onRendered(Component component)
   {
       if(component.getRequestCycle().getRequestTarget() instanceof
AjaxRequestTarget) {
           ... cast to ART ...
           target.appendJavascript(getScript());
       }
   }
}

hth,
jim

On 11/28/06, Alberto Bueno <[EMAIL PROTECTED]> wrote:

My problem is that I want to call to a javascript method after the
rendering of a page or after the rendering of the component with ajax.

Now I have a border and I want to add in the component an onload event.
For instance:

<body onload="alert('test')";>
      <wicket:border>
    <wicket:child/>
    </wicket:border>
</body>

The alert runs correctly if I use the border in the page. But if I
update the border
with ajax, the alert is not rendered.

Who can I do to add the alert in both cases?

Thanks

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to