Wicket
  1. Wicket
  2. WICKET-3719

Component's markup cannot be found in Ajax requests if the parent is transparent

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5-RC4
    • Fix Version/s: 1.5-RC5
    • Component/s: wicket
    • Labels:
      None

      Description

      When TransparentWebMarkupContainer is used an inner markup container cannot find its markup on Ajax updates.
      The problem seems to be caused by the fact that ComponentResolvers#resolve() is not executed and since there is transparent container involved Markup.find(String) cannot find the markup for non-transparent markup containers.
      I'll commit a disabled test case that shows the problem.

      1. WICKET-3719.patch
        3 kB
        Martin Grigorov

        Issue Links

          Activity

          Hide
          Martin Grigorov added a comment -

          The test case is org.apache.wicket.markup.html.TransparentWebMarkupContainerTest.bug_testAjaxUpdate(), remove 'bug_' from the method name to be able to start it.

          Show
          Martin Grigorov added a comment - The test case is org.apache.wicket.markup.html.TransparentWebMarkupContainerTest.bug_testAjaxUpdate(), remove 'bug_' from the method name to be able to start it.
          Hide
          Martin Grigorov added a comment -

          A patch that solves the problem

          Show
          Martin Grigorov added a comment - A patch that solves the problem
          Hide
          Martin Grigorov added a comment -

          Hi Juergen,

          Can you please review the fix in the attached patch?
          Thanks!

          Show
          Martin Grigorov added a comment - Hi Juergen, Can you please review the fix in the attached patch? Thanks!
          Hide
          Martin Grigorov added a comment -

          Set the "Fix version" to 1.5 RC5 so we wont forget it.

          Show
          Martin Grigorov added a comment - Set the "Fix version" to 1.5 RC5 so we wont forget it.
          Hide
          Juergen Donnerstag added a comment -

          I enabled the test case but don't get any error. All tests including testAjaxUpdate() are successful. Could you please verify and either update the test case or close it. Thanks.

          Show
          Juergen Donnerstag added a comment - I enabled the test case but don't get any error. All tests including testAjaxUpdate() are successful. Could you please verify and either update the test case or close it. Thanks.
          Hide
          Martin Grigorov added a comment -

          With r1132403 I modified the test case so now it reproduces the problem again.
          Now it uses custom PageManager that clones the stored page so that it loses its "private transient Markup markup" and later clicking the Ajax link will fail to find the ajax-updated component with:

          org.apache.wicket.markup.MarkupNotFoundException: Markup not found for Component: [TransparentWithAjaxUpdatePanel [Component id = panel]]
          at org.apache.wicket.Component.internalRender(Component.java:2382)
          at org.apache.wicket.Component.render(Component.java:2342)
          at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:941)
          at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:755)
          at org.apache.wicket.ajax.AjaxRequestTarget.constructResponseBody(AjaxRequestTarget.java:645)
          at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:601)
          at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:717)
          at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63)
          at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:96)
          at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
          at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
          at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:548)
          at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:490)
          at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:462)
          at org.apache.wicket.util.tester.BaseWicketTester.executeBehavior(BaseWicketTester.java:935)
          at org.apache.wicket.util.tester.BaseWicketTester.clickLink(BaseWicketTester.java:1574)
          at org.apache.wicket.markup.html.TransparentWebMarkupContainerTest.testAjaxUpdate(TransparentWebMarkupContainerTest.java:100)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at junit.framework.TestCase.runTest(TestCase.java:168)
          at junit.framework.TestCase.runBare(TestCase.java:134)
          at junit.framework.TestResult$1.protect(TestResult.java:110)
          at junit.framework.TestResult.runProtected(TestResult.java:128)
          at junit.framework.TestResult.run(TestResult.java:113)
          at junit.framework.TestCase.run(TestCase.java:124)
          at junit.framework.TestSuite.runTest(TestSuite.java:243)
          at junit.framework.TestSuite.run(TestSuite.java:238)
          at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
          at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

          Show
          Martin Grigorov added a comment - With r1132403 I modified the test case so now it reproduces the problem again. Now it uses custom PageManager that clones the stored page so that it loses its "private transient Markup markup" and later clicking the Ajax link will fail to find the ajax-updated component with: org.apache.wicket.markup.MarkupNotFoundException: Markup not found for Component: [TransparentWithAjaxUpdatePanel [Component id = panel] ] at org.apache.wicket.Component.internalRender(Component.java:2382) at org.apache.wicket.Component.render(Component.java:2342) at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:941) at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:755) at org.apache.wicket.ajax.AjaxRequestTarget.constructResponseBody(AjaxRequestTarget.java:645) at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:601) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:717) at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63) at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:96) at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212) at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253) at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:548) at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:490) at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:462) at org.apache.wicket.util.tester.BaseWicketTester.executeBehavior(BaseWicketTester.java:935) at org.apache.wicket.util.tester.BaseWicketTester.clickLink(BaseWicketTester.java:1574) at org.apache.wicket.markup.html.TransparentWebMarkupContainerTest.testAjaxUpdate(TransparentWebMarkupContainerTest.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:243) at junit.framework.TestSuite.run(TestSuite.java:238) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

            People

            • Assignee:
              Juergen Donnerstag
              Reporter:
              Martin Grigorov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development