Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 2 如何将动态项添加到关联菜单?_Jsf 2_Richfaces_Contextmenu_Html - Fatal编程技术网

Jsf 2 如何将动态项添加到关联菜单?

Jsf 2 如何将动态项添加到关联菜单?,jsf-2,richfaces,contextmenu,html,Jsf 2,Richfaces,Contextmenu,Html,我正在将我的应用程序迁移到jsf2和richfaces 4.3.1,我的组件rich:contextMenu有问题 上下文菜单应该有一些最终项(如代码段中的“All”项),其他项取自“bean”中定义的列表属性 在jsf1.2和richfaces 3.3.x中,“c:forEach”元素工作得很好,但在新配置中没有。有什么想法吗 代码片段如下所示: <rich:contextMenu id="menu" showEvent="click" target="panel" mode="ajax

我正在将我的应用程序迁移到jsf2和richfaces 4.3.1,我的组件rich:contextMenu有问题

上下文菜单应该有一些最终项(如代码段中的“All”项),其他项取自“bean”中定义的列表属性

在jsf1.2和richfaces 3.3.x中,“c:forEach”元素工作得很好,但在新配置中没有。有什么想法吗

代码片段如下所示:

<rich:contextMenu id="menu" showEvent="click" target="panel" mode="ajax" >

    <rich:menuItem label="All" action="#{bean.search}" render="list">
        <a4j:param assignTo="#{bean.currentLabelId}" value="0" />
    </rich:menuItem>

    <c:forEach var="item" value="#{bean.labelSelectItemList}">

        <rich:menuItem label="#{item.label}" action="#{bean.search}" render="list">
            <a4j:param name="param1" assignTo="#{bean.currentLabelId}" value="#{item.value}" />
        </rich:menuItem>

    </c:forEach>

</rich:contextMenu>

仅从评论中总结解决方案:

替换
http://java.sun.com/jstl/core
名称空间url发生的原因
http://java.sun.com/jsp/jstl/core
()

还有davidml评论:

另一个错误:c:forEach需要一个“项目”阿曲布他 “价值”


检查是否使用了c:组件的正确xml命名空间。应该是
xmlns:c=”http://java.sun.com/jsp/jstl/core“
(非
http://java.sun.com/jstl/core
),你说得对!我还有一个错误:c:forEach需要一个“物品”而不是“价值”,但是如果没有你的帮助,我是不会明白的!thx很多;)不客气。我已将我们的评论总结为一个答案。