title: primefaces tab on click
body: <p>I have a primefaces tab view like this :</p>
  
  <pre><code>&lt;p:tabView id="tabView"&gt;  
      &lt;p:tab id="tab1" title="Godfather Part I"&gt;  
          This tab has static content.
      &lt;/p:tab&gt;  
  
      &lt;p:tab id="tab2" title="Godfather Part II"&gt;  
          this tab has a datatable whose  
      &lt;/p:tab&gt;  
  &lt;/p:tabView&gt;
  </code></pre>
  
  <p>Now, what I want to do is, fire a managedbean method when user clicks on tab2. I can add an actionlistener on tabchange event of tabView but this will fire the method on click of tab1 too. How do I fire a method on click of tab2 only?</p>