I’ve ran into some problems when using nested enclosures, and I’d like to know if it’s a bug in my coding, or if the usage I’m trying is just not natively supported.
Stuff like:
<wicket:enclosure child="primary">
<wicket:message key="primary.select">Primary Server</wicket:message>
<select id="primary" wicket:id="primary"></select>
<wicket:enclosure child="backup">
<wicket:message key="backup.label"/>
<span id="backup" wicket:id="backup"></span>
</wicket:enclosure>
</wicket:enclosure>
The question is simply whether it’s OK to use HTML like this, I want to make sure of that before I start looking for issues on the visibility controllers.
I’ve dug into some documentation and search engines for a while, but haven’t found any mention to nested enclosures being supported, or not supported.
Thanks!
Sorry for such a late response, I hadn’t seen your comment.
I don’t believe that there are any documented limitations related to nesting <wicket:enclosure> tags; however, there are a few other limitations to the tag that have been documented.
The first limitation is documented in the Wicket tag doc:
and
And second, there is a closed issue regarding hiding FormComponents using a <wicket:enclosure> tag. Basically any FormComponent hidden by the tag will still be validated on Form submission. If you watch your logs, there is a warning message given for this issue.
Note: The term “Documented” for Wicket is somewhat ambiguous. I suppose you just have to get used to piecing together information from various sources in order to find answers to your questions. When in doubt, try to find the javadoc or inline comments for the source code. Those are usually the best documented sources.