[
https://issues.apache.org/jira/browse/WICKET-3843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13057072#comment-13057072
]
Martin Grigorov commented on WICKET-3843:
-----------------------------------------
Works OK in 1.5.
The exception is :
org.apache.wicket.WicketRuntimeException: Could not find child with id: msg in
the wicket:enclosure
at
org.apache.wicket.markup.html.internal.Enclosure.checkChildComponent(Enclosure.java:270)
at
org.apache.wicket.markup.html.internal.Enclosure.getChildComponent(Enclosure.java:249)
at
org.apache.wicket.markup.html.internal.Enclosure.onInitialize(Enclosure.java:134)
at org.apache.wicket.Component.fireInitialize(Component.java:916)
....
> NPE with wicket:enclosure attribute and hierarchy mismatch
> ----------------------------------------------------------
>
> Key: WICKET-3843
> URL: https://issues.apache.org/jira/browse/WICKET-3843
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.4.17
> Reporter: Adrian Sandor
>
> Please refer to the example code:
> public class TestPage extends WebPage {
> public TestPage() {
> add(new WebMarkupContainer("d"));
> add(new Label("msg", "hi"));
> }
> }
> TestPage.html:
> <html xmlns:wicket>
> <body>
> <div wicket:id="d">
> <div wicket:enclosure="msg"><span wicket:id="msg"></span></div>
> </div>
> </body>
> </html>
> The label is wrongly added to the page instead of the "d" container, but I am
> expecting wicket to show a nice error message instead of this:
> java.lang.NullPointerException
> at
> org.apache.wicket.markup.html.internal.InlineEnclosure.onAfterRenderChildren(InlineEnclosure.java:81)
> at org.apache.wicket.Component.afterRender(Component.java:1039)
> at
> org.apache.wicket.MarkupContainer.onAfterRenderChildren(MarkupContainer.java:1805)
> at org.apache.wicket.Component.afterRender(Component.java:1039)
> at
> org.apache.wicket.MarkupContainer.onAfterRenderChildren(MarkupContainer.java:1805)
> at org.apache.wicket.Component.afterRender(Component.java:1039)
> at org.apache.wicket.Page.renderPage(Page.java:936)
> [...]
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira