我想这个问题与我也面临的问题非常相似。请允许我对这个问题进行一些说明。
当“p:dialog”下有两个“ui:include”时我遇到了这个问题。像这样
<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>
现在,当我尝试启动 8500.xhtml 时,我的 showCidSelect 参数值总是返回“null”。如果我按如下方式替换代码,这可以正常工作
<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="showCidSelect" value="1" />
<ui:param name="department" value="8" />
<ui:param name="stackedObject" value="#{customerDetailsInquiry.cf8444.cg1014.cg1014cidnumb}" />
</ui:include>
</h:form>
</p:dialog>
我必须为两个“ui:include”显式传递 showCidSelect 才能使其工作。
这可能是您也面临的同样问题吗?
发布一些 UI 示例代码。