Hello.

I have a case where I'm trying to refresh the parent page from a popup page.

On the parent page I have:

        AbstractDefaultAjaxBehavior clientSideCallingBehavior =
                new AbstractDefaultAjaxBehavior() {
                    protected void respond(AjaxRequestTarget target) {
                        System.out.println("Refreshing .......");
                    }
                };

Label lblCallback = new Label("refreshJS", new LoadableDetachableModel() {

            protected Object load() {
String callbackScript = "var callRefresh = function(value) { wicketAjaxGet('"
                        + clientSideCallingBehavior.getCallbackUrl(false)
+ "', null, null, function() {return true;}); return false;}";
                return callbackScript;
            }
        });
        lblCallback.add(clientSideCallingBehavior);
        lblCallback.setEscapeModelStrings(false);
        add(lblCallback);


In the popup page I have on a link call the callRefresh method:
        AjaxLink cancel = new AjaxLink("cancel") {
            public void onClick(AjaxRequestTarget target) {
                target.appendJavascript("window.opener.callRefresh();");
            }
        };

org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.WicketRuntimeException: component right-content-panel-container:right-content-panel-id:details-panel:tabs:panel:refreshJS not found on page com.asf.ufe.web.pages.evaluation.AccountEvaluationPage[id = 2], listener interface = [RequestListenerInterface name=IBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:262)
    at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
    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:1115) Caused by: org.apache.wicket.WicketRuntimeException: component right-content-panel-container:right-content-panel-id:details-panel:tabs:panel:refreshJS not found on page com.asf.ufe.web.pages.evaluation.AccountEvaluationPage[id = 2], listener interface = [RequestListenerInterface name=IBehaviorListener, method=public abstract void org.apache.wicket.behavior.IBehaviorListener.onRequest()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
    ... 26 more

If I do make the call to callRefresh from the Parent Page(the same page where the behaviour is located) with onclick="callRefresh();return false;" it works.

Do you have any ideeas? Does it have to be the last page in the PageMap for ajax to work?
Thanks.


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

Reply via email to