[
https://issues.apache.org/jira/browse/WICKET-3833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13054235#comment-13054235
]
Matt Brictson commented on WICKET-3833:
---------------------------------------
Thanks for the quick turnaround.
The patch does indeed resolve the problem in the original quickstart. If a
component is made invisible via setVisible(false), the entire enclosure is
hidden and none of the child components are rendered. So this is correct.
However if I change the scenario slightly such that the component is made
invisible due to isRenderAllowed() == false (i.e. because of an
IAuthorizationStrategy), the problem still occurs. The other child components
are still rendered. Furthermore, in this scenario the enclosure itself is not
being hidden, which is an even bigger problem.
I'm attaching another quickstart for the isRenderAllowed() == false scenario.
> Components inside an invisible <wicket:enclosure> are still rendered
> --------------------------------------------------------------------
>
> Key: WICKET-3833
> URL: https://issues.apache.org/jira/browse/WICKET-3833
> Project: Wicket
> Issue Type: Bug
> Components: wicket-core
> Affects Versions: 1.5-RC5.1
> Reporter: Matt Brictson
> Assignee: Juergen Donnerstag
> Attachments: WICKET-3833-2-quickstart.tgz,
> WICKET-3833-quickstart.tgz, wicket-3833.patch
>
>
> Consider this example:
> <wicket:enclosure child="invisible">
> This entire enclosure should be hidden.
> <p wicket:id="invisible"></p>
> <p wicket:id="shouldntrendereither"></p>
> </wicket:enclosure>
> If the "invisible" component is indeed invisible, then the entire enclosure
> is also invisible. Furthermore this implies that none of the components
> within the enclosure will be rendered. However this is not the case. Even
> though the "shouldntrendereither"
> component is in the same enclosure and therefore should not be rendered,
> Wicket attempts to render it.
> This was not the case in Wicket 1.4.x.
> See the attached quickstart.
> This is a serious problem for two reasons:
> 1. For performance, it does not make sense to render components, and
> therefore potentially load model objects from the database, etc. if those
> components are ultimately not being displayed.
> 2. In my experience, <wicket:enclosure> is used to hide components that would
> otherwise fail to render, due to non-existent data or unauthorized access.
> Pages that have been built under the assumption that hidden components are
> not rendered (a very reasonable assumption) may now fail with exceptions in
> Wicket 1.5.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira