我有一个xhtml,其中有一个带有2个标签的手风琴面板:
<p:accordionPanel id="accordianPanel">
<p:tab title="Type of movement" id="typeOfMovementTab"
<typeofmovement:typeOfMovementPanelGuiData id="typeOfMovementPanelGuiData"
typeOfMovementPanelGuiData="#{cc.attrs.searchCriteriaSecuritiesEntriesViewGUIData.typeOfMovementPanelGuiData}" />
</f:subview>
</p:tab>
<p:tab title="Client" id="clientTab" rendered="#{cc.attrs.searchCriteriaSecuritiesEntriesViewGUIData.typeOfMovementPanelGuiData.typeOfMovement == 'ONLY_RECOUNCILE_MOVEMENT'}"
<customer:customerCPanelGUIData id="customerCPanelGUIData"
customerCPanelGUIData="#{cc.attrs.searchCriteriaSecuritiesEntriesViewGUIData.customerCPanelGUIData}" />
</f:subview>
</p:tab>
<p:accordionPanel>
现在我想根据 typeOfMovementTab 中的单选按钮选择呈现 clientTab 。我尝试做ajax:更新内部的typeOfMovementPanelGuiData(typeOfMovementTab)如下所示,但它不会对radion按钮更改造成任何影响:
<p:selectOneRadio id="typeOfMovementSelectOneRadio" value="#{cc.attrs.typeOfMovementPanelGuiData.typeOfMovement}" layout="custom">
<f:selectItem itemLabel="#{typeOfMovementPanelMsg['typeofmovement.onlyclientmovements']}" itemValue="ONLY_CLIENT_MOVEMENT"/>
<f:selectItem itemLabel="#{typeOfMovementPanelMsg['typeofmovement.onlyunreconciledmovements']}" itemValue="ONLY_RECOUNCILE_MOVEMENT"/>
<f:selectItem itemLabel="#{typeOfMovementPanelMsg['typeofmovement.bothclientandunreconciledmovements']}" itemValue="BOTH_CLIENT_RECOUNCILE_MOVEMENT"/>
<p:ajax event="click" process="@this" update=":searchAndConsultSecurityForm:searchCriteriaSecuritiesEntriesViewGUIDataPanel:accordianPanel:clientTab"/>
</p:selectOneRadio>
我在控制台中看到了以下警告:
WARNING: Can not update component "org.primefaces.component.tabview.Tab" with id
&#34; searchAndConsultSecurityForm:searchCriteriaSecuritiesEntriesViewGUIDataPanel:一个 ccordianPanel:clientPanel&#34;没有附加的渲染器。表达&#34;:searchAndCo nsultSecurityForm:searchCriteriaSecuritiesEntriesViewGUIDataPanel:accordianPanel :clientPanel&#34;引自&#34; searchAndConsultSecurityForm:searchCriteriaSecuri tiesEntriesViewGUIDataPanel:accordianPanel:typeOfMovement:typeOfMovementPanelGui 数据:typeOfMovementSelectOneRadio&#34;
更新:
我使用f:ajax
和render
<p:selectOneRadio id="typeOfMovementSelectOneRadio" value="#{cc.attrs.typeOfMovementPanelGuiData.typeOfMovement}" layout="custom">
<f:selectItem itemLabel="#{typeOfMovementPanelMsg['typeofmovement.onlyclientmovements']}" itemValue="ONLY_CLIENT_MOVEMENT"/>
<f:selectItem itemLabel="#{typeOfMovementPanelMsg['typeofmovement.onlyunreconciledmovements']}" itemValue="ONLY_RECOUNCILE_MOVEMENT"/>
<f:selectItem itemLabel="#{typeOfMovementPanelMsg['typeofmovement.bothclientandunreconciledmovements']}" itemValue="BOTH_CLIENT_RECOUNCILE_MOVEMENT"/>
<f:ajax event="click" process="@this" render="@form"/>
</p:selectOneRadio>
答案 0 :(得分:0)
尝试使用此模板:
<p:outputPanel id="parentPanel">
<p:outputPanel id="childPanel">
THE ELEMS THAT RENDER THE HIDDEN ELEMS: "render="THE id OF YOUR HIDDEN ELEMS TO SHOW""
</p:outputPanel>
<p:outputPanel id="customPanel">
<p:outputPanel rendered="YOUR RENDER CONDITION">
YOUR HIDDEN ELEMS
</p:outputPanel>
</p:outputPanel></p:outputPanel>