我想在我的支持bean中检索ui:param的值但是从同一页面检索不是在页面之间导航时我尝试过:
FaceletContext faceletContext = (FaceletContext) FacesContext.getCurrentInstance().getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
String formId = (String) faceletContext.getAttribute("formId");
,它也返回了null我也试过了:
String param = FacesContext.getCurrentInstance().getExternalContext()
.getRequestParameterMap().get(name);
它也返回null我尝试在preRenderView和postValidate事件中获取这些valies并以两种方式返回null
不要忘记我想得到一个ui:param的值页面我在
答案 0 :(得分:-1)
我认为这个问题与我所面临的问题非常相似。 请允许我对这个问题有所了解。
当我在“p:对话框”下包含两个“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示例代码。