AjaxEventBehaviour on page onload

2011-03-03 Thread drf
I wonder if anyone can help with the following:
I've added this code to a the constructor of a WebPage:

this.add(new AjaxEventBehavior(onload) {

@Override
protected void onEvent(AjaxRequestTarget target) {
System.out.println( IN on-LOAD);
}
});

Am expecting the event to be called when the page loads, but it is not.
Here is the snippet for the page head:



VCF



Any ideas are appreciated!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxEventBehaviour-on-page-onload-tp618p618.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: AjaxEventBehaviour on page onload

2011-03-03 Thread Pedro Santos
You can implement an IHeaderContributor:

http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/html/IHeaderContributor.html
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/html/IHeaderResponse.html#renderOnLoadJavascript(java.lang.String)
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/html/IHeaderResponse.html#renderOnLoadJavascript(java.lang.String)
On Thu, Mar 3, 2011 at 1:00 PM, drf davidrfi...@gmail.com wrote:

 I wonder if anyone can help with the following:
 I've added this code to a the constructor of a WebPage:

this.add(new AjaxEventBehavior(onload) {

@Override
protected void onEvent(AjaxRequestTarget target) {
System.out.println( IN
 on-LOAD);
}
});

 Am expecting the event to be called when the page loads, but it is not.
 Here is the snippet for the page head:



VCF



 Any ideas are appreciated!

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AjaxEventBehaviour-on-page-onload-tp618p618.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Pedro Henrique Oliveira dos Santos