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

Using Enclosure within a Border

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 9.1.0
    • None
    • wicket-core
    • None

    Description

      Hi Wicket Team,

       

      it seems there is an error during the detach of a Border when there is an enclosure used.

       

      Java-Class

      public class BorderWithEnclosure extends Border {
      
         public BorderWithEnclosure(final String id, final IModel<?> model) {
            super(id, model);
      
            addToBorder(new WebMarkupContainer("myContainer", Model.of("Text")));
         }
      
      }
      
      
      

       

      HTML-File:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html>
      <html xmlns:wicket="http://wicket.apache.org">
         <head><meta charset="UTF-8"></head>
         <body>
            <wicket:border>
               <div class="another-container">
                  <wicket:enclosure>
                     <div wicket:id="myContainer">
                        <wicket:body/>
                     </div>
                  </wicket:enclosure>
               </div>
            </wicket:border>
         </body>
      </html>
      

      The enclosure could also be move one line up (then it make much more sense) but the error will stay.

       

       

      Error:

       

      // Code-Platzhalter
      [main] ERROR org.apache.wicket.request.cycle.RequestCycle - Error detaching RequestCycle[main] ERROR org.apache.wicket.request.cycle.RequestCycle - Error detaching RequestCycleorg.apache.wicket.WicketRuntimeException: An error occurred while detaching component: [BorderWithoutEnclosure [Component id = border, page = org.apache.wicket.util.tester.BaseWicketTester$StartComponentInPage, path = border, type = com.ing.BorderWithoutEnclosure, isVisible = true, isVersioned = true, markup = [markup = org.apache.wicket.util.resource.StringResourceStream@512baff6: <html><head></head><body><span wicket:id='border'></span></body></html><span wicket:id="border"></span>, index = 0, current =  '<span wicket:id="border">' (line 0, column 0)]], children =  [WebMarkupContainer [Component id = myContainer]][Enclosure [Component id = wicket_enclosure-651342894-651342893]]] at org.apache.wicket.Component.detach(Component.java:1126) at org.apache.wicket.MarkupContainer.detachChildren(MarkupContainer.java:1687) at org.apache.wicket.Component.detach(Component.java:1131)
      ...
      ...
      ...
      Caused by: org.apache.wicket.WicketRuntimeException: Detach called on component with id 'border' while it had a non-empty queue: ComponentQueue{queueSize=1, queue=[[BorderBodyContainer [Component id = border_body]], null, null, null, null, null, null, null]}Caused by: org.apache.wicket.WicketRuntimeException: Detach called on component with id 'border' while it had a non-empty queue: ComponentQueue{queueSize=1, queue=[[BorderBodyContainer [Component id = border_body]], null, null, null, null, null, null, null]} at org.apache.wicket.MarkupContainer.onDetach(MarkupContainer.java:1804) at org.apache.wicket.Component.detach(Component.java:1107) ... 82 more
      
      

       

       

      I Uploaded a quickstart. With a Border implementation without und with an enclosure an a Test for this.

       

      Hopefully it helps.

       

      Regards

      Lukas

       

       

       

       

      Attachments

        1. quickstart.zip
          29 kB
          Lukas Wapper

        Activity

          People

            Unassigned Unassigned
            LukasING Lukas Wapper
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: