when i try to get active index any accordion panel then its always return -1 value. I am using primefaces 7.0 version.
When i try to enable form tag then it is not working with the process of flow step wise.
I have also try other solutions from stackoverflow but nothing tobe work for me. Anyone have idea about this.
1.example.xhtml
<!-- <h:form> -->
<ui:fragment
rendered="#{not empty excursionResultsBean.excursionAvailabilities and not empty excursionResultsBean.excursionAvailabilities[0].excursionCategoryBeans}">
<p:accordionPanel multiple="false"
activeIndex="#{panelDisplayBean.index}" role="tablist" id="indexId" cache="false" >
<f:ajax event="tabChange"
listener="#{excursionResultsBean.onTabChange}" update="@form"/>
<ui:insert name="creditCardPanel1">
<ui:include src="step1.xhtml" />
</ui:insert>
<ui:insert name="creditCardPanel2">
<ui:include src="step2.xhtml" />
</ui:insert>
<ui:insert name="creditCardPanel3">
<ui:include src="step3.xhtml" />
</ui:insert>
<ui:insert name="creditCardPanel4">
<ui:include src="step4.xhtml" />
</ui:insert>
</p:accordionPanel>
</ui:fragment>
<ui:fragment
rendered="#{empty excursionResultsBean.excursionAvailabilities or empty excursionResultsBean.excursionAvailabilities[0].excursionCategoryBeans}">
<div>
<p>Sorry! We're booked to capacity on your flight</p>
Please share your travel details with us at <b><a
href="mailto:guest.ss@ss.com">guest.ss@ss.com</a></b>,
so that we can work on this specially for you! Or call
</div>
</ui:fragment>
<!-- </h:form> -->
method in bean
public void onTabChange(TabChangeEvent event) {
UITabPanel tabView = (UITabPanel) event.getComponent();
int activeTab = tabView.getChildren().indexOf(event.getTab());
System.out.println("Active index "+activeTab);
}