title: How to get dynamic tab names and data using tabView in PrimeFaces 5.0?
body: <p>I need to display tab names dynamically. Each of the tabs will then have its own list of data.
  For e.g. If tab name is "Student", it will display a list of students when user clicks on "Student" tab. If "Teacher" tab is clicked, it will display a list of teachers.
  I was referring PrimeFaces examples using below link.
  <a href="http://www.primefaces.org/showcase/ui/panel/tabView.xhtml" rel="nofollow">http://www.primefaces.org/showcase/ui/panel/tabView.xhtml</a> </p>
  
  <p>I tried using Data Model and Ajax event examples, but I am unable to display desired data.  events do not work with Data Model.</p>
  
  <p>I have tried below methods,</p>
  
  <pre><code>&lt;p:tabView value="#{myBean.tabList}" var="tabItem"&gt;
      &lt;p:tab title="#{tabItem.tabTitle}"&gt;
          &lt;h:outputText value="#{tabItem.valueA}"/&gt;
  
      &lt;/p:tab&gt;
  &lt;/p:tabView&gt;
  </code></pre>
  
  <p>If I use this method, data is dynamic, but not the way I want. My data is like Tab Name is a list and data for each tab is another list.</p>
  
  <pre><code>TabView tabView = new TabView();
  Tab newTab = new Tab();            
  newTab.setTitle("Tab Title");  
  
  Tab newTab2 = new Tab();            
  newTab2.setTitle("Tab Title2");     
  tabView.getChildren().add(newTab2); 
  </code></pre>
  
  <p>Can anyone help out?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I am now able to display dynamic data as required by creating PrimeFaces code from backing bean. TabView is inside a <code>&lt;p:dialog&gt;</code> box.</p>
  
  <pre><code>out1 = new SelectBooleanCheckbox();
  out1.setValue(obj.isTabViewCheckBox());
  out2 = new HtmlOutputLabel();
  out2.setValue(obj.getTaskName());
  </code></pre>
  
  <p>I am facing new issue.. I am not able to get the SelectBooleanCheckbox value after the  is submitted.
  XHTML Code:</p>
  
  <pre><code>&lt;p:dialog header="#{BB.projNo}" widgetVar="addData" modal="true" showEffect="explode" hideEffect="explode" styleClass="editProjects"&gt;
  &lt;h:panelGrid id="TaskAdd"&gt;
      &lt;f:facet name="header"&gt;
          &lt;h:outputText value="Tasks"/&gt;
      &lt;/f:facet&gt;
      &lt;p:tabView id="tabView" binding="#{BB.tabView}"&gt;
      &lt;/p:tabView&gt;
  &lt;/h:panelGrid&gt;
  &lt;p:commandButton id="saveBtn" action="#{BB.addTask}" value="Save"  style="align:center;" styleClass="buttonStyle" onstart="showLoadImg();" oncomplete="hideLoadImg();PF('addData').hide();add();" &gt;
  &lt;/p:commandButton&gt;
  &lt;/p:dialog&gt;
  </code></pre>
  
  <p>How to get the value of the selected items on  submit?</p>