dynamic ui:include with el-expression?
I'm using JSF 2.0.
Is there a way to make this code work?
<ui:repeat value="#{theBean.tabList}" var="tab">
<h:pane开发者_开发问答lGroup rendered="#{theBean.chose == tab.tabHash}">
<h:outputText value="TESTING #{tab.tabName} (#{tab.tabFile})" />
<ui:include src="#{tab.tabFile}" />
</h:panelGroup>
</ui:repeat>
Specifically, the line <ui:include src="#{tab.tabFile}" />
.
Currently I get a blank page (Meaning, I guess, that #{tab.tabFile}
evaluated to null\empty.)
Thanks!
The <ui:include>
runs during view build time (to generate the JSF component tree) while the <ui:repeat>
runs during view render time (to generate the HTML output), which is after the view build time. Use <c:forEach>
instead of <ui:repeat>
, it runs during view build time as well.
See also:
c:forEach
vsui:repeat
in Facelets
精彩评论