The following code implements a datatable inside a layout, in the datatable I added a menu Button whose menu Item updates the content of a dialog "outside the table" upon clicking it. I get this error upon running the cde at the browser:
JBWEB000065: HTTP Status 500 - Cannot find component with identifier ":choice" referenced from "form:accounts:0:j_idt11".
Here is the code:
<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>
Update: When I add the dialog inside the databale it is seen by the menu button, but it either doesn't display properly, or opens and can't be closed.