Reputation: 3241
Accordionpanel tabs are not closed when moving the second time to the page, even with activeIndex="" the tabs are closed only the first time moving to the page. I'm using Primefaces 3.5 and MyFaces 2.1.5.
<p:accordionPanel id="accordionServers" style="width:400px" multiple="true" activeIndex="" cache="false" dynamic="true">
<p:tab title="Tab1"></p:tab>
<p:tab title="Tab2"></p:tab>
</p:accordionPanel>
What is the simplest workaround?
Upvotes: 0
Views: 7758
Reputation: 51
In my scenario setting activeIndex="-1" or activeIndex="null" or activeIndex="-" or activeIndex="" did not work.
I returned -1 from manager bean and it worked. Getter always returns -1 and setter does nothing.
activeIndex="#{managerBean.activeTabIndices}"
p.s. I needed all tabs to be always closed initially.
Upvotes: 2
Reputation: 111
You can close all tab of an accordion by JavaScript, using JQuery, as the code below.
for (var i = 0; i< $(".ui-accordion-header").size(); i++) {
PF('accordionWidgetVarName').unselect(i);
}
Upvotes: 0
Reputation: 492
activeIndex="-", in Primefaces 3.4, when multiple="true"
<p:accordionPanel
id="accordionServers"
style="width:400px"
multiple="true"
activeIndex="-"
cache="false"
dynamic="true">
<p:tab title="Tab1" />
<p:tab title="Tab2" />
</p:accordionPanel>
Upvotes: 2