By default the first tab of the primefaces accordion panel is shown open on page load. Is there a way that it can be closed on page load.
Thanks
You can just do
<p:accordionPanel activeIndex="-1">
One approach is to define a widgetVar:
<p:accordionPanel widgetVar="accordion">
...
</p:accordionPanel>
And then:
<body onload="PF('accordion').unselect(0)">
or for older PF versions:
<body onload="accordion.unselect(0)">
It works if you set activeIndex to blank (Primefaces 3.4.1).
<p:accordionPanel activeIndex="">
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