I need to get the intex of an oppened tab. I'm using this ajax on the accordionPanel:
<p:ajax event="tabChange" listener="#{ambienteController.onAccordionTabChange}" />
And this is the bean:
public void onAccordionTabChange(final TabChangeEvent event) {
AccordionPanel view = (AccordionPanel) event.getComponent();
this.accordionTabIndex = view.getActiveIndex();
System.out.println(this.accordionTabIndex);
}
The sysout is always printing 0 as the index of the current active tab, this is messing me up since i use that info to add files to specific tabs that reflect environments the user has, so all files end up on the first tab. Thanks in advance.