使用 ICEFaces 输出列表内容
我想使用 ICEFaces 显示一个列表,并且我想将其输出为:TAG1、TAG2、TAG3。
但是如果不使用 , 或 <% for (...) { ... } %>,有办法做到这一点吗?
谢谢!
I want to show a List using ICEFaces, and I want to output it like:TAG1, TAG2, TAG3.
But without using , or <% for (...) { ... } %>, is there a way to do this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ICEfaces 不提供任何将“逻辑”放入视图中的机制(渲染属性是唯一的方式)。
不过,我建议您看一下另外两个 JSF 标记:c:forEach 和 ui:repeat
您将在以下两个命名空间中找到它们
:根本区别,因为 c:forEach 是 TagHandler 而 ui:repeat 是 Component。 它基本上取决于您想要在循环中输出的内容以及您选择的方式。 当视图构建时,它们将在不同阶段进行评估。
我推荐 Roger Keays 撰写的一篇博客文章,其中比较了 c:forEach 和 ui:repeat 并列出了一些典型问题:
Roger Keays,2007。Facelets 中的 c:forEach 与 ui:repeat
更新:
有 ice:panelSeries 组件进行迭代在给定的对象集合上。
ICEfaces doesn't provide any mechanism for putting "logic" inside views (the rendered property is the only kind-of way).
However, I would propose you to take a look at two other JSF tags: c:forEach and ui:repeat
You'll find them in the following two namespaces:
There are fundamental differences, since c:forEach is a TagHandler and ui:repeat a Component. It will basically depend on the content you want to output within the loop, which way you choose. They'll be evaluated at different phases when the view is built.
I'd recommend a blog post by Roger Keays which compares c:forEach and ui:repeat and lists some typical issues:
Roger Keays, 2007. c:forEach vs ui:repeat in Facelets
Update:
There's the ice:panelSeries component which iterates over a given collection of objects.