使用< ui:repeat>传递参数 [英] passing parameters using <ui:repeat>

查看:85
本文介绍了使用< ui:repeat>传递参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用forEach将参数传递给函数,代码如下

I was using forEach for passing parameters to a function,the code is as follows

 <c:forEach var="q" items="#{statusBean.commentList(p.statusId)}">

但是当我转移到<ui:repeat>时,没有传递参数,这给了我一个例外.

but when I shifted to <ui:repeat>, the parameters were not being passed,it is giving me an exception.

<ui:repeat var="q" value="#{statusBean.commentList(p.statusId)}">

除了使用<ui:repeat>传递参数之外,是否还有其他选择.

Is there any alternative to passing parameters using <ui:repeat>.

推荐答案

您的问题毫无意义.没有通过<ui:repeat>传递参数",也没有通过<c:forEach>传递参数".在某些特定的上下文中,您的单词可能有意义-但缺少上下文.

Your question is meaningless. There is no "passing parameters by <ui:repeat>" and there is no "passing parameters using <c:forEach>". Your words might make sense in some specific context - but the context is missing.

您描述的两个标记具有完全不同的作用:一个构建一个组件(<ui:repeat>),另一个预处理一个将用于构建视图的文档.区别是深远的(从创建UI的形状,评估绑定的时间,与保存的GUI状态的交互开始...),以及-从询问问题的方式来看-您需要了解更多在解决此特定问题之前.没关系,请花些时间.

The two tags you describe do entirely different things: one builds a component (<ui:repeat>), the other one pre-processes a document that will serve to build view. The difference is profound (beginning with the shape of UI that is created, the time when the binding is evaluated, interactions with saved GUI state...) and - judging from the way you ask the question - you need to understand a lot more before you tackle this specific problem. That's all right, just take your time.

但是我有一个诚实的建议:如果<c:foreach>为您工作(如果只是偶然的话),那么就使用它吧!请勿尝试用完全不同的东西(以及您没有得到的东西)代替它.

But I have an honest advice: if <c:foreach> works for you (if only by chance), then just use it! Don't try to replace it with something altogether different (and something that you don't get).

这篇关于使用&lt; ui:repeat&gt;传递参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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