I'm using primefaces 3.5 with JSF mojarra 2.2.
I've a page with two ui:include which are wrapped in a p:dialog and ui:param is being used to pass values in/out of the includes.
<p:dialog header="Customer Selection Criteria" widgetVar="customerSelectionDialog" width="1200" position="center" appendToBody="true">
<h:form id="customerForm">
<p:outputPanel id="customerSelection">
<ui:include src="../INTERNAL/8500.xhtml">
<ui:param name="showCidSelect" value="1" />
<ui:param name="targetObject" value="#{customerDetailsInquiry.cf8444.cg1014.cg1014cidnumb}" />
</ui:include>
<p:commandButton rendered="false" value="#{COMMON.COMMON_SELECTBUTTON}" action="#{customerDetailsInquiry.tchelp.handleReturnFromCustomerSelectionCriteria}" oncomplete="customerSelectionDialog.hide();" update=":mainForm:cf8444icg1014c1002" >
<f:setPropertyActionListener value="#{customerSearchEngine}" target="#{flash.customerSearchEngine}"/>
</p:commandButton>
</p:outputPanel>
</h:form>
</p:dialog>
<p:dialog closeOnEscape="true" modal="true" appendToBody="false" header="Entity Stack" widgetVar="entityStackDialog" width="400" >
<h:form id="entityForm">
<ui:include src="../INTERNAL/StackedEntity.xhtml">
<ui:param name="displayCaption" value="CID Numbers" />
<ui:param name="department" value="8" />
<ui:param name="stackedObject" value="#{customerDetailsInquiry.cf8444.cg1014.cg1014cidnumb}" />
</ui:include>
</h:form>
</p:dialog>
Backing Bean:
FaceletContext faceletContext = (FaceletContext) FacesContext.getCurrentInstance().getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
String paramValue = (String) faceletContext.getAttribute("showCidSelect");
now the problem is with "showCidSelect" parameter.
showCidSelect determines whether to show "select" button in 8500.xhtml or not.
Since "showCidSelect" in this above example is set to "1", select button should be rendered.
Without the second dialog for "StackedEntity.xhtml" this works perfectly fine.
But when i put second dialog and its ui:param's this stops working and FaceletContext getAttribute call returns null.
As of now i'm forced to include "showCidSelect" in both dialogs, then everything works fine. But i somehow feel there is some other better possible solution for this problem.
Request expert help