Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3079

Nested fragments markup not found

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5-M2.1
    • 1.5-M3
    • wicket
    • None
    • Windows, Jetty 7

    Description

      I have the following markup:

      <body>
      <wicket:extend>
      <span wicket:id="FragmentA_container"></span>

      <wicket:fragment wicket:id="FragmentA">
      <span wicket:id="FragmentB_container"></span>

      <wicket:fragment wicket:id="FragmentB">
      <span wicket:id="child_component">
      </wicket:fragment>
      </wicket:fragment>
      </wicket:extend>
      </body>

      FragmentA is added to the page it has added a child of type FragmentB. Also, FragmentB's markup is defined inside FragmetnA.
      In the Java code, when FragmentB is added to FragmentA, FragmentA is specified as markup provider for FragmentB.

      In this case wicket throws an exception:
      Markup not found for Component: [ [Component id = child_component]]

      I have experienced this behavior in several occasions and I've noticed that if a fragment's markup is defined inside another fragment this exception is thrown. The problem occurs because the Fragment.getMarkup(final Component child) method returns null. This worked in wicket 1.4.9.

      Attachments

        1. fragments_test.rar
          7 kB
          Ivan Vasilev
        2. fragments_test.tgz
          4 kB
          Martin Tzvetanov Grigorov
        3. wicket-3079.patch
          11 kB
          Juegen Donnerstag

        Activity

          People

            jdonnerstag Juegen Donnerstag
            hok Ivan Vasilev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: