I'm using Primefaces (version 3.0.1) p:tabView
component, which displays dynamic number of tabs backed by a list in a model. Tabs inside TabView are closable. I'd like to remove list element associated with a tab by close event.
Here is my view:
<p:tabView id="tabView" var="iterator" value="#{bean.list}">
<p:ajax event="tabClose"
listener="#{bean.removeElement(iterator)}" process="@this" />
<p:tab id="tab" closable="true">
<h:outputText value="#{iterator.text}" />
</p:tab>
</p:tabView>
My bean handler:
public void removeElement(Element e) {
this.list.remove(e);
}
Element e
is null in this case
I've also tried to use p:collector
inside p:ajax
element. There is example at primefaces.org showcase. According to it my event handler should look like
public void removeElement(TabCloseEvent event) {
// ...
}
But I don't know how can I get associated with tab list element.
All answers will be appreciated. Thanks in advance