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

When using an Ajax request to display initially hidden components inside inline enclosures, only the first one appears.

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.14.0
    • 7.0.0-M1, 6.16.0
    • wicket
    • None
    • Windows, Java 7

    Description

      Consider a simple page with an Ajax link and two initially hidden labels, each of which is inside its own inline enclosure. Clicking the link makes the labels visible and adds each to the AjaxRequestTarget.

      Here is the behavior I see: Upon initial page render, each of the two labels is rendered as a hidden inline enclosure div. This is correct. But upon clicking the Ajax link, only the first label appears, and I get an AJAX DEBUG error indicating that the second label couldn't be found.

      I've isolated the issue. In the class org.apache.wicket.protocol.http.AjaxEnclosureListener, there is a call to "visit.stop(key)". This halts the entire visitation, and therefore only the first inline enclosure is added to the AjaxRequestTarget.

      The fix, IMO, would be to simply remove the current key from the map once an enclosure is added to the target. Don't call stop, and get rid of the local variable "key" which limits the logic of AjaxEnclosureListener to a single enclosure.

      It was working for multiple enclosures prior to the checkin of 2013-08-06.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mgrigorov Martin Tzvetanov Grigorov
            jamesflagg James Flagg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment