You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by drf <da...@gmail.com> on 2011/03/03 17:00:25 UTC

AjaxEventBehaviour on page onload

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-tp3333618p3333618.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: AjaxEventBehaviour on page onload

Posted by Pedro Santos <pe...@gmail.com>.
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 <da...@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-tp3333618p3333618.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos