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

Page.checkRendering fails after setting BorderBodyContainer visiblity to false

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4-RC5
    • 1.4.0
    • wicket
    • None
    •       <groupId>org.apache.wicket</groupId>
            <artifactId>wicket</artifactId>
            <version>1.4-rc5</version>

    Description

      After toggling visibility of the BorderBodyContainer to false the Page.checkRendering method fails in line 1157, claiming an iterator IllegalStateException. This happens because iterator.remove() is called twice for a child component in the border component, if the body is not visible.

      My Code:

      public class TogglePanel extends Border {
      private boolean expanded = true;

      public TogglePanel(String id, IModel<String> titleModel) {
      super(id, titleModel);

      Link link = new Link("title") {

      @Override
      public void onClick()

      { expanded = !expanded; getBodyContainer().setVisible(expanded); }

      };
      link.add(new Label("titleLabel", titleModel));

      add(link);
      }

      }

      Markup:

      <wicket:border>
      <h3 class="collapse" wicket:id="title">
      <span class="label" wicket:id="titleLabel">Panel Title</span>
      <a class="foldicon"> </a>
      </h3>
      <wicket:body />
      </wicket:border>

      Attachments

        1. wicket-2368.patch
          8 kB
          Juegen Donnerstag

        Activity

          People

            jdonnerstag Juegen Donnerstag
            mfrankerl Michael Frankerl
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: