I’m trying to create a accordion panel which is load dynamically with a bean, and it has to trigger method on other bean that gets clicked tabs title when user click on a tab.Panel creation is working well and listener is called also,but the listener not getting the clicked items title.can anyone point me the problem or point me the right way of doing this.
.xhtml
<p:accordionPanel activeIndex="-1" dynamic="true" cache="false"
value="#{beanOne.ItemList}"
var="item">
<p:ajax event="tabChange" listener="#{beanTwo.onTabChange}" />
<p:tab title="#{item.title}">
//view other content of item
</p:tab>
</p:accordionPanel>
bean
public void onTabChange(TabChangeEvent event) {
System.out.println("onTabChange :"+event.getTab().getTitle());
}
i think it happens because panel loads tabs dynamically.but is there any alternative ?
Finally I did it.
i change my beans onTabChange method like this.And it is working…
it does not give tab.title but it gives the object(item) related to that clicked tab.