title: PrimeFaces "tabChange" event with dynamic number of tabs
body: <p>I need to get title of currently active tab inside my TabView. TabView is constructed with dynamic number of tabs with listener attached to "tabChanged":</p>
  
  <pre><code>&lt;p:tabView value="#{bean.list}" var="listItem"&gt;
    &lt;p:ajax event="tabChange" listener="#{listenerBean.onChange}" /&gt;
    &lt;p:tab title="#{listItem.stringProperty}"&gt;
    &lt;/p:tab&gt;
  &lt;/p:tabView&gt;
  </code></pre>
  
  <p>The problem is that TabChangeEvent object received by onChange(TabChangeEvent event) always contains first tab instead of the active one.</p>
  
  <pre><code>public void onChange(TabChangeEvent event) {
      event.getTab().getTitle(); //allways returns title of first tab
  }
  </code></pre>
  
  <p>This behavior is only true for dynamic number of tabs in TabView if I define each tab explicitly, TabChangeEvent works fine.</p>
  
  <p>Any suggestions? Thanks. </p>
  
  <p>I use PrimeFaces 3.5 with JSF2.1 and Servlets 2.5 </p>