Harshal Chaudhari
Harshal Chaudhari

Reputation: 99

Wicket panel (Dialog) in not working?

I am trying to open a dialog on register link using new Dialog() as follows "register" & "registerpanel" these are two div that I added into html page as wicket:id="register" & wicket:id="registerpanel".

// register panel

registerDialog = new Dialog("register");
registerDialog.add(new CustomerRegistrationPanel("registerpanel", registerDialog));
add(registerDialog);

        // Register
        lnkRegister = new AjaxFallbackLink<String>("lnkRegister") {

            @Override
            public void onClick(AjaxRequestTarget ajaxRequestTarget) {
                // ajaxRequestTarget.add(registerPanel);
                registerDialog.open(ajaxRequestTarget);
                //setResponsePage(CustomerProfilePage.class);
            }

            @Override
            public boolean isVisible() {
                return !ZipSession.get().isValid();
            }
        };
        add(lnkRegister);

But I am getting an errror as,

Root cause:

org.apache.wicket.markup.MarkupNotFoundException: Failed to find markup file associated. CustomerRegistrationPanel: [CustomerRegistrationPanel [Component id = register]]
at org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.getMarkup(AssociatedMarkupSourcingStrategy.java:97)
at org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:448)
at org.apache.wicket.Component.getMarkup(Component.java:737)
at org.apache.wicket.Component.getMarkupTag(Component.java:1422)
at org.apache.wicket.Component.getMarkupIdFromMarkup(Component.java:777)
at org.apache.wicket.Component.getMarkupIdImpl(Component.java:1479)
at org.apache.wicket.Component.getMarkupId(Component.java:1525)
at org.apache.wicket.Component.getMarkupId(Component.java:1592)
at com.visural.wicket.component.dialog.Dialog$1.getDivId(Dialog.java:68)
at com.visural.wicket.component.dialog.Dialog$1.getJS(Dialog.java:59)
at com.visural.wicket.component.dialog.Dialog$1.renderHead(Dialog.java:54)
at org.apache.wicket.Component.renderHead(Component.java:2707)
at org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy$1.component(ChildFirstHeaderRenderStrategy.java:82)
at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:96)
at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87)
at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87)
at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87)
at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:51)
at org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderChildHeaders(ChildFirstHeaderRenderStrategy.java:77)
at org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderHeader(ChildFirstHeaderRenderStrategy.java:56)
at org.apache.wicket.markup.html.internal.HtmlHeaderContainer.onComponentTagBody(HtmlHeaderContainer.java:134)
at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:72)
at org.apache.wicket.Component.internalRenderComponent(Component.java:2556)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1534)
at org.apache.wicket.Component.internalRender(Component.java:2386)
at org.apache.wicket.Component.render(Component.java:2314)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1432)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1596)
at org.apache.wicket.Page.onRender(Page.java:907)
at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:140)
at org.apache.wicket.Component.internalRender(Component.java:2386)
at org.apache.wicket.Component.render(Component.java:2314)
at org.apache.wicket.Page.renderPage(Page.java:1035)
at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224)
at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:140)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

Plz help me out for this. Thanks in advance.

Upvotes: 0

Views: 5210

Answers (3)

Martin
Martin

Reputation: 1273

I Didn't find the answer in this question when I encountered this problem so I came back to give the solution I found. Here's my list of checks for this problem.

  • Check if all < wicket:extend>, < wicket:child> and < wicket:panel> and tags are correct (by thoredge and Nicky)
  • Check if there's an .html in the same dir a .java wicket file (by Robert Niestroj)
  • Check if there aren't any settings that make wicket search in different locations for the .html file.
  • Check any OS differences for case sensitivity in Path (see comment: HaMMeReD)
  • Check if the .html file is also copied at build-time to the same dir as the .class file.
  • Check if the .html is also added to the .war file.

Hope this helps the people that also forgot that one line in their ant build file ;)

Upvotes: 4

thoredge
thoredge

Reputation: 12591

Even if you have correctly named and placed the html-file you can get this error if you're using the wrong root-element inside it.

For example starting with <wicket:extend...> instead of <wicket:panel...>.

Upvotes: 13

Robert Niestroj
Robert Niestroj

Reputation: 16131

It seems that you are missing the html file for the class CustomerRegistrationPanel. Look for a file named CustomerRegistrationPanel.html and see if it is in the same directory as the .java file.

Upvotes: 1

Related Questions