I have an xhtml page that display a Datatable with entries. I also have a button to insert a new entry, that displays a dialog that has a form. The insertion form is used as <ui:include>
in the parent .xhtml as follows:
Parent file
<h:form id="mainForm">
<p:commandButton process="@form" update=":dlgGrp" oncomplete="dlg.show()"/>
<p:datatable id = "datatable">
various columns
.....
.....
</p:datatable>
</h:form>
<p:dialog widgetVar="dlg" >
<h:panelGroup id="dlgGrp">
<ui:include src="include.xhtml" />
</h:panelGroup>
</p:dialog>
</ui:composition>
Dialog file
<ui:composition xmlns . . .>
<h:form id="subForm">
various input fields
......
......
<p:commandButton process="@form" update=":mainForm" oncomplete="dlg.hide()"/>
</h:form>
</ui:composition>
How can I refer generically to a parent component as show in the file. In a few words as soon as I hit the submit button in the dialog, I want to update the main form and hide the dialog. These components however are in the "parent field".
This should probably be done programatically through the backing bean, since I do not want to include parent-specific actions in the child .xhtml, since I may aslo want to use it as a standalone .xhtml.