动态ui:包括el-expression吗? [英] dynamic ui:include with el-expression?
问题描述
我正在使用JSF 2.0.
I'm using JSF 2.0.
有没有办法使此代码正常工作?
Is there a way to make this code work?
<ui:repeat value="#{theBean.tabList}" var="tab">
<h:panelGroup rendered="#{theBean.chose == tab.tabHash}">
<h:outputText value="TESTING #{tab.tabName} (#{tab.tabFile})" />
<ui:include src="#{tab.tabFile}" />
</h:panelGroup>
</ui:repeat>
具体地说,是行<ui:include src="#{tab.tabFile}" />
.
目前,我得到一个空白页(我想这意味着#{tab.tabFile}
评估为null \ empty.)
Specifically, the line <ui:include src="#{tab.tabFile}" />
.
Currently I get a blank page (Meaning, I guess, that #{tab.tabFile}
evaluated to null\empty.)
谢谢!
推荐答案
<ui:include>
在视图构建时运行(以生成JSF组件树),而<ui:repeat>
在视图渲染时运行(以生成HTML输出) ),即在视图构建时间之后.使用<c:forEach>
代替<ui:repeat>
,它也会在视图构建期间运行.
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.
-
c:forEach
vsui:repeat
这篇关于动态ui:包括el-expression吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!