I have a .xhtml file contains 1 form and 1 dialog, as example:
<h:form id="frmMain">
<p:dataTable id="tblFormItem"
widgetVar="wgFormItem">
<p:column>
...
</p:column>
</p:dataTable>
<p:commandButton value="Add value"
onstart="PF('dlg').show()"
oncomplete="PF('dlg').hide()"
action="#{bean.openDialog}"/> <!-- openDialog() will open a dialog has id "dialog" -->
</h:form>
<p:dialog id="dialog"
widgetVar="wgDialog">
<h:form id="dialogForm">
<!-- Some stuffs -->
<p:commandButton value="Save"
update=":messages :frmMain:tblFormItem"
action=#{bean.save}"/>
I got the error Cannot find component for expression ":frmMain:tblFormItem"
.
I searched and tried everything that I found on Google but it still produces the same error.
Please help me, how do I update the dataTable from commandButton in dialog?