Details
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.