1

在一个选项卡中,我可以点击一个按钮来显示“h:groupPanel”。如果我这样做,然后更改活动选项卡,刚刚出现的 groupPanel 仍然可见,并出现在当前选项卡的顶部。

tabView 的代码是:

<p:tabView dynamic="true" cache="false" id="characterTabView">
    <p:tab title="View" id="viewTab">
         <ui:include src="/sections/character/view.xhtml" />
     </p:tab>
    <p:tab title="Upgrade" id="upgradeTab">
        <ui:include src="/sections/character/upgrade.xhtml" />
    </p:tab>
</p:tabView>

“升级”页面看起来像

<h:panelGroup id="searchCompetencies" rendered="#{characterBean.rightPanel == 'searchResult'}">
    <h:panelGroup styleClass="characterUpgradeLeft">
        <ui:include src="/sections/character/searchViewLeft.xhtml" />
    </h:panelGroup>
    <h:panelGroup id="competencyCreation" rendered="#{characterBean.rightPanel == 'competencyCreation'}">
        <!--  The panel that is made visible -->
    </h:panelGroup>

以及使组件可见的页面(searchViewLeft):

<p:fieldset legend="Create competency" styleClass="createCompetencyStart">
    <h:form>
        <p:commandButton value="Create competency" type="button" onclick="toggleCreate()" update="upgradeTab" />
    </h:form>
</p:fieldset>

其中“toggleCreate”改变了“characterBean.rightPanel”的值。

你知道我在这里缺少什么吗?

非常感谢 :)

4

0 回答 0