Wicket
  1. Wicket
  2. WICKET-1829

MarkupComponentBorder skips first tag in MarkupStream

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.4
    • Fix Version/s: 1.3.5, 1.4-RC1
    • Component/s: wicket
    • Labels:
      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.

        Activity

        Scott MacKenzie created issue -
        Scott MacKenzie made changes -
        Field Original Value New Value
        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 com.cucbc.wicket.component.input.MDFieldBorder. 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 MDFieldBorder 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.
        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 com.cucbc.wicket.component.input.MDFieldBorder. 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.
        Scott MacKenzie made changes -
        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 com.cucbc.wicket.component.input.MDFieldBorder. 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.
        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.
        Igor Vaynberg made changes -
        Assignee Igor Vaynberg [ ivaynberg ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.4-M4 [ 12313295 ]
        Fix Version/s 1.3.5 [ 12313175 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        3d 11h 11m 1 Igor Vaynberg 16/Sep/08 06:59

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            Scott MacKenzie
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development