0
votes

I want to know how to do show a panelgroup if is selected specific tab of accordionPanel Primefaces.

<p:accordionPanel id="myAccordion" activeIndex="1">
    <p:tab title="first" id="tab0">
        ...
    </p:tab>
    <p:tab title="second" id="tab2">
        ...
    </p:tab>
</p:accordionPanel>


<h:panelGroup id="myPanelGroup" rendered="#{myAccordion.activeIndex=='0'}">
...
</h:panelGroup>

Thank you.

H

1

1 Answers

3
votes

Just check prime face showcase they have ajax event for your reference

<p:ajax event="tabChange" listener="#{tabbedView.onTabChange}" update=":form:msgs" />
<p:ajax event="tabClose" listener="#{tabbedView.onTabClose}" update=":form:msgs" />

Once you get your tab index you can do whatever you want to do and update your panel according your need. https://www.primefaces.org/showcase/ui/panel/accordionPanel.xhtml