Quantcast

AjaxEventBehaviour on page onload

classic Classic list List threaded Threaded
2 messages Options
drf
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

AjaxEventBehaviour on page onload

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:

<head>
        <wicket:head>
        <title>VCF</title>
        </wicket:head>
</head>

Any ideas are appreciated!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: AjaxEventBehaviour on page onload

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 <[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Pedro Henrique Oliveira dos Santos
Loading...