Hi, We have several issues in Jira related to the same problem - <wicket:enclosure> hides its children/parents from the other components while traversing the tree. See https://issues.apache.org/jira/browse/WICKET-5214 and my last comment for the links to the other tickets.
There is a simple solution to this problem - use EnclosureContainer explicitly in Java code. I'd like to deprecate <wicket:enclosure> and remove Enclosure, InlineEnclosure and the related classes. Until now I think we have removed only <wicket:component> in Wicket 1.5 but it wasn't used so much. Do you see another solution ?