title: p:dialog not showing in tabs on tabview
body: <p>I have a weird problem with JSF2 Primefaces 5.2. This can be easily replicated using the code below.</p>
  
  <p>I am creating a dialog inside a tab (inside tabview) using the onclick of p:command button. The first tab, it works fine. After adding a new tab dynamically (using the value attribute of p:tabView), the dialog is working fine on the second tab as well. </p>
  
  <p>However, if I click on the first tab again and click the command button, the whole page gets dimmed out and I am not able to click anywhere on the screen.</p>
  
  <p>Any ideas? thank you.</p>
  
  <pre><code>                &lt;p:panel header="materials Pages" id="materialsPagesPanel"&gt;
              &lt;p:commandButton value="+ Add material Page" id="addmaterialPage"
                                  action="#{guideBean.addmaterialPage}" ajax="true" process="@this" update="createGuideForm"/&gt;
  
          &lt;p:tabView value="#{guideBean.materialComboList}" var="materialCombo" orientation="left" id="materialsTabs" activeIndex="#{guideBean.materialActiveTab}"&gt;
              &lt;p:tab title="material Page #{materialCombo.pageNumber}"&gt;
  
                  &lt;div class="materialPageHeading"&gt;&lt;h:outputText value="material Page #{materialCombo.pageNumber}"/&gt;&lt;/div&gt;   
  
                  &lt;p:commandButton id="pickmaterialsButton" type="button" onclick="PF('dlg').show();" value="Pick materials" process="@this"/&gt; 
  
                  &lt;p:dialog header="Search for materials" widgetVar="dlg" modal="true" width="900" height="600" resizable="false"&gt;
  
                          Testing
                      &lt;br /&gt;
                      &lt;p:commandButton value="Select" process="@this"
                                   action="#{guideBean.savematerialsFromPickList(materialCombo.pageNumber)}"
                                   oncomplete="PF('dlg').hide()"&gt;
                          &lt;/p:commandButton&gt;
                  &lt;/p:dialog&gt;
  
  
              &lt;/p:tab&gt;
          &lt;/p:tabView&gt;
  
  
          &lt;/p:panel&gt;
  </code></pre>
  
  <p>The code in the backing bean to dynamically add tabs:</p>
  
  <pre><code>    public String addmaterialPage() 
  {
      MaterialCombo materialCombo = new MaterialCombo();
      //materialComboList is a class variable
      materialComboList.add(materialCombo);
      return "";
  }
  </code></pre>