I have the following construct at several places in my webapp in order to conditionally render page fragments depending on some actions:
<h:panelGroup rendered="#{managedBean.serviceSelected == 'insurance'}">
<ui:include src="/pages/edocket/include/service1.xhtml" />
</h:panelGroup>
I have observed, that the <ui:include>
is still executed even when the rendered
attribute evaluates false
. This unnecessarily creates all backing beans associated with the service1.xhtml
file which is been included.
How can I skip executing the <ui:include>
when the parent UI component is not rendered, so that all those backing beans are not unnecessarily created?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…