Jsf Primefaces对话框id可以';从数据表内部看t bee

Jsf Primefaces对话框id可以';从数据表内部看t bee,jsf,primefaces,Jsf,Primefaces,下面的代码实现了布局内部的datatable,在datatable中我添加了一个菜单按钮,单击该按钮的菜单项可更新“表外”对话框的内容。 在浏览器上运行cde时出现以下错误: JBWEB000065: HTTP Status 500 - Cannot find component with identifier ":choice" referenced from "form:accounts:0:j_idt11". 代码如下: <html xmlns="http://www.w3.org

下面的代码实现了布局内部的datatable,在datatable中我添加了一个菜单按钮,单击该按钮的菜单项可更新“表外”对话框的内容。 在浏览器上运行cde时出现以下错误:

JBWEB000065: HTTP Status 500 - Cannot find component with identifier ":choice" referenced from "form:accounts:0:j_idt11".
代码如下:

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui">
<h:head>
    <link type="text/css" rel="stylesheet"
        href="#{request.contextPath}/style.css" />
</h:head>
<h:body>
    <h:form id="form">
        <p:dialog header="You selected" widgetVar="dlg" id="choice" resizable="false" modal="true">
                    This item.
                </p:dialog>

        <p:layout style="min-width:400px;min-height:200px;" id="layout">
            <p:layoutUnit position="center">
                <p:dataTable id="accounts" var="account" value="pop" rowKey="1">

                    <p:column headerText="ID"></p:column>

                    <p:column headerText="Option">

                        <p:growl id="messages" />
                        <p:menuButton value="">
                            <p:menuitem value="1" update="choice" oncomplete="dlg.show()" />
                            <p:menuitem value="2" update="choice" oncomplete="dlg.show()" />
                            <p:menuitem value="3" update="choice" oncomplete="dlg.show()" />
                        </p:menuButton>
                    </p:column>
                </p:dataTable>
            </p:layoutUnit>
        </p:layout>


    </h:form>
</h:body>
</html>

这个项目。
更新:当我在数据表中添加对话框时,它会被菜单按钮看到,但它要么不能正确显示,要么无法打开和关闭。

在您的情况下,
将在其组件前面加上它的id。要消除此错误,请从



有用的链接

可能重复的:
<p:menuitem value="1" update="choice" oncomplete="dlg.show()" />
<p:menuitem value="1" update=":form:choice" oncomplete="dlg.show()" />