You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "GLEIZES Stephane (JIRA)" <ji...@apache.org> on 2013/05/28 10:28:20 UTC
[jira] [Created] (WICKET-5209) NPE when using
ComponentRenderer.renderComponent on a panel with
GLEIZES Stephane created WICKET-5209:
----------------------------------------
Summary: NPE when using ComponentRenderer.renderComponent on a panel with <wicket:enclosure>
Key: WICKET-5209
URL: https://issues.apache.org/jira/browse/WICKET-5209
Project: Wicket
Issue Type: Bug
Components: wicket
Affects Versions: 6.8.0
Reporter: GLEIZES Stephane
Hi,
Consider this example:
<wicket:panel>
<wicket:enclosure child="externalLink">
<a wicket:id="externalLink">Link</a>
</wicket:enclosure>
</wicket:panel>
When trying to render such a panel with ComponentRenderer.renderComponent, a NPE is thrown because Wicket try to render Enclosure without initializing it.
Root cause:
java.lang.NullPointerException
at org.apache.wicket.markup.html.internal.Enclosure.isVisible(Enclosure.java:143)
at org.apache.wicket.Component.determineVisibility(Component.java:4363)
at org.apache.wicket.Component.internalBeforeRender(Component.java:916)
at org.apache.wicket.Component.beforeRender(Component.java:991)
at org.apache.wicket.Component.internalPrepareForRender(Component.java:2214)
at org.apache.wicket.Component.render(Component.java:2303)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1390)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1554)
at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1529)
at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:689)
at org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderAssociatedMarkup(AssociatedMarkupSourcingStrategy.java:76)
at org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.onComponentTagBody(PanelMarkupSourcingStrategy.java:112)
at org.apache.wicket.Component.internalRenderComponent(Component.java:2549)
... 29 more
See the attached quickstart.
I've looked a little into it, and it seems that RenderPage (used by ComponentRenderer to render components) is never initialized.
Therefore the panel's children are never initialized too (see MarkupContainer l.930), and this causes Enclosure to have a null childComponent.
Thanks.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira