动态ui:包括ui内部:重复。有简单的解决方案吗? [英] Dynamic ui:include inside ui:repeat. Is there a simple solution?

查看:129
本文介绍了动态ui:包括ui内部:重复。有简单的解决方案吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想动态选择一个facelet来渲染我的数据列表中的一些项目。第一次尝试是:

I want to dynamically pick a facelet to render some item in my data list. The first try would be:


<ui:repeat value="#{panels}" var="panel">
  <ui:include src="#{panel.facelet}">
</ui:repeat>

但是由于ui:include的src过早评估,因此无法正常工作。 facelet信息是真正动态的,所以我不能使用c:forEach(不是真的建议与facelets混合使用)。我想这一切都归结为找到一个基于ui的组件:包含替代品。

But it won't work since src of ui:include is evaluated too early. The facelet information is truly dynamic, so I cannot use c:forEach (not really recommended to mix with facelets either). I guess it all boils down to finding a component based ui:include alternative.

是否有这样的事情或我需要自己编写?

Is there such thing or I need to write my own?

推荐答案

c:forEach会解决它,你为什么不能使用它?

c:forEach will solve it, why can't you use it?

有趣的文章关于这个问题:
http:// www.ilikespam.com/blog/c:foreach-vs-ui:repeat-in-facelets

Interesting article regarding that issue: http://www.ilikespam.com/blog/c:foreach-vs-ui:repeat-in-facelets

这篇关于动态ui:包括ui内部:重复。有简单的解决方案吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆