Details
Description
when i try to use addrenderheaderlistener in application with header contributor using methods other than renderonloadjavascript and
renderOnDomReadyJavascript,i get the exception as ajaxrequesttarget expects
"Only methods that can be called on IHeaderResponse outside renderHead() are renderOnLoadJavascript and renderOnDomReadyJavascript
attaching a quickstart that shows the behavior where ajaxselfupdatingtimer is used.
exception as follows :-
Only methods that can be called on IHeaderResponse outside renderHead() are renderOnLoadJavascript and renderOnDomReadyJavascript
org.apache.wicket.WicketRuntimeException: Only methods that can be called on IHeaderResponse outside renderHead() are renderOnLoadJavascript and renderOnDomReadyJavascript
at org.apache.wicket.ajax.AjaxRequestTarget$AjaxHeaderResponse.checkHeaderRendering(AjaxRequestTarget.java:872)
at org.apache.wicket.ajax.AjaxRequestTarget$AjaxHeaderResponse.renderJavascriptReference(AjaxRequestTarget.java:915)
at com.mycompany.WicketApplication$1.renderHead(WicketApplication.java:28)
at org.apache.wicket.Application.notifyRenderHeadListener(Application.java:1250)
at org.apache.wicket.markup.html.internal.HeaderResponse.<init>(HeaderResponse.java:56)
at org.apache.wicket.ajax.AjaxRequestTarget$AjaxHeaderResponse.<init>(AjaxRequestTarget.java:951)
at org.apache.wicket.ajax.AjaxRequestTarget.getHeaderResponse(AjaxRequestTarget.java:1018)
at org.apache.wicket.ajax.AbstractAjaxTimerBehavior.respond(AbstractAjaxTimerBehavior.java:163)
at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:286)
at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:119)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)