Conditional config.xhtml
Posted: 23 Jan 2021, 19:14
How can I do the <ui:include src="./config.xhtml" /> to be conditional (preferred with JSF only, w/o JSTL)?
I've tried below, when myBean.edit boolean equal to true, no luck
of course template.xhtml and config.xhtml are in the same path.
I've tried below, when myBean.edit boolean equal to true, no luck
Code: Select all
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<h:head />
<h:body>
<h:panelGroup id="viewPanel1">
<h:panelGroup id="tableRenderPanel2" rendered="#{myBean.edit}">
<ui:include src="./config.xhtml" />
</h:panelGroup>
</h:panelGroup>
</h:body>
</html>