开发者

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 vs ui:repeat in Facelets
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜