I can't get all p:accordionPanel tabs closed
I tried both solutions recommended in Question Hiding the first tab of accordion panel in JSF Primefaces but it does not work for me in case the value attribute of the accordionPanel is an EL expression. the first tab is always open.
I tried
<p:accordionPanel widgetVar="accordion"
multiple="true"
value="#{cc.attrs.managedBean.getTabs()}" var="r">
without success
and
<p:accordionPanel activeIndex="-1"
multiple="true" value="#{cc.attrs.managedBean.getTabs()}" var="r">
works only if there is no value attribut of accordionPanel
thanks for any help.
I have primesfaces 3.3.1
Using 'null' worked for me: <p:accordionPanel activeIndex="null">
I'm using PF 3.5 and setting activeIndex to null leaves the tabs closed by default.
I am using PF 3.5 and with this version I have realized that if I give a negative number for activeIndex
greater than the number of tabs in the p:accordianPanel, it collapses all the tabs. E.g.
<p:accordionPanel activeIndex="-2">
<p:tab title="Hello">
</p:tab>
<p:tab title="World">
</p>
</p:accordionPanel>
Shows the accordian with all tabs collapsed. Let me know if this works for you or if you have found another solution. Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With