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

MarkupComponentBorder skips first tag in MarkupStream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.4
    • 1.3.5, 1.4-RC1
    • wicket
    • None

    Description

      If there is no leading markup in a MarkupComponentBorder before the <wicket:border/> tag, the following error will occur:

      Unexpected tag encountered in markup of component border TestComponentBorder. Tag: <wicket:body/>, expected tag: <wicket:border>

      Steps to reproduce:
      Create a ComponentBorder with no leading markup before <wicket:border/>:

      TestComponentBorder.html
      --------------------------------------
      <wicket:border>
      <div class="input">
      <wicket:body/>
      </div>
      </wicket:border>

      TestComponentBorder.java
      --------------------------------------
      public class TestComponentBorder extends MarkupComponentBorder
      {
      }

      This happens because the rendering loop calls stream.next(); when it starts, always skipping the first element. It should call stream.get() before the loop, then stream.next() at the end.

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            smackie Scott MacKenzie
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: