I have got a problem with the HtmlDataTable of JSF 2.0. On my web page, i have got a h:dataTable and some other content, which should only be rendered if the user is logged in.
The content of the HtmlDataTable is loaded from a database. Although the h:dataTable is not rendered when the user is not logged in, the content is still evaluated.
Here is the code of the web page:
<h:panelGroup rendered="#{userBean.loggedIn}">
<h:dataTable value="#{xxxBean.allXxx}"
var="c">
<h:column>
<h:outputText value="#{c.name}"/>
</h:column>
</h:dataTable>
<!-- some other content -->
</h:panelGroup>
In the getAllXxx() method I am logging the call of the method. But also if the h:dataTable (and all the other content) is not rendered, the getAllXxx() method is still called.
I tried to use c:if instead of the h:panelGroup. That would work, but then I get issues during the login-process, so this is no suitable solution.
Does anyone know how to fix this? Thanks in advance.