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

Ajax repaint is not correctly handled when component being repainted has an enclosure associated with it and is not a child of the enclosure



    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 7.10.0, 8.1.0
    • 7.11.0, 8.2.0
    • None


      When a component is repainted with ajax we first check if that component is a controlling component of the enclosure and if it is we repaint the enclosure instead of the component. However, we make the assumption that the controlling component of the enclosure is always contained within the enclosure, which may not always be true with inline enclosures.

      For example:

      <label wicket:child="name" wicket:for="name">Name</label>
      <input type="text" wicket:id="name"/>

      In this case the inline enclosure will only encompass the label. So if we repaint the textfield by adding it to the ajax request handler we will get a strange result where any header contributions associated with the name component will get rendered, but the markup for the name component will not - because we make the assumption that since it is controlling an enclosure it is also inside it so there is no point in repainting it directly.


      One may argue that controlling components have to be inside the enclosure and we should throw an error if they are not, but I prefer this more flexible approach which allows the controller to be outside.




            ivaynberg Igor Vaynberg
            ivaynberg Igor Vaynberg
            0 Vote for this issue
            3 Start watching this issue