title: Unable to refresh datatable in jsf after tab change
body: <p>This is my requirement. I am supposed to add a record and upon successful addition and clicking on the 'View' tab, the datatable should refresh, but the table remains unchanged. I am fetching the data into the datatable from a backing bean using the getter method. </p>
  
  <p>Inside datatable:</p>
  
  <pre><code>&lt;p:dataTable id="ci_table" value="#{ciConfigBean.ciList}" var="cid" scrollable="true" selectionMode="single" selection="#{ciConfigBean.ciConfigSave}"
              rowKey="#{cid.ciConfigId}" editable="true" resizableColumns="true"&gt;
  </code></pre>
  
  <p>I even tried using javascript methods by calling them from onTabChange event.</p>
  
  <p>1st function:  </p>
  
  <pre><code>function onLoad() {
               alert("tab"); 
              var oTable;
              oTable = $('#ci_table').dataTable();
              oTable.fnClearTable( 0 );
              oTable.fnDraw();
          }
  </code></pre>
  
  <p>2nd function:</p>
  
  <pre><code>var oTable;
              $(document).ready(function() {
                      oTable = $('#ci_table').dataTable({
                          "bProcessing" : true,
                          "bServerSide" : true,
                          "sAjaxSource" : '${request.contextPath}'
                                  + '/ciConfigBean/getCiList'
                          });
                          oTable.fnReloadAjax();
                  });
  </code></pre>
  
  <p>Tab change code:</p>
  
  <pre><code>&lt;p:tab id="ci" title="CI"&gt;
              &lt;p:tabView id="insideCi" onTabChange="onLoad()"
                  activeIndex="#{home.activeInner}"&gt;
                  &lt;p:tab id="ciList" title="CI List"&gt;
                      &lt;ui:include src="ci/ciList.xhtml" /&gt;
                  &lt;/p:tab&gt;
                  &lt;p:tab id="newCi" title="New CI"&gt;
                      &lt;ui:include src="ci/newCi.xhtml" /&gt;
                  &lt;/p:tab&gt;
              &lt;/p:tabView&gt;
          &lt;/p:tab&gt;
  </code></pre>
  
  <p>But nothing seems to work. Any suggestions on this?</p>