2017-09-05 24 views
0

À l'origine, j'ai utilisé un dataTable modifiable, et cela a fonctionné correctement. Ensuite, je mets le dataTable dans les onglets d'un ongle dymanic, puis dans le premier onglet rendu fonctionne très bien, mais après avoir changé de tabulation, je ne peux pas éditer des cellules. version PrimeFaces: 6,0Primefaces dataTable ne peut pas être modifié après la modification de l'onglet

<p:tabView value="#{tippingViewBean.rounds}" var="round" dynamic="true"> 

    <p:tab title="#{round}."> 

     <p:dataTable id="tippingTable#{round}" rowIndexVar="rowId" editable="true" editMode="cell" 
        widgetVar="cellTips" 
        var="userTip" value="#{tippingViewBean.getUserTips(round)}" 
        resizableColumns="true"> 

      <p:ajax event="cellEdit" listener="#{tippingViewBean.addTip(userTip)}"/> 

      <p:column headerText="Kezdés"> 
       <h:outputText value="#{userTip.schedule.date}"/> 
      </p:column> 
      <p:column headerText="Hazai Csapat"> 
       <h:outputText value="#{userTip.schedule.homeTeam.name}"/> 
      </p:column> 
      <p:column headerText="Vendég Cspat"> 
       <h:outputText value="#{userTip.schedule.awayTeam.name}"/> 
      </p:column> 
      <p:column headerText="Győztes"> 
       <p:cellEditor> 
        <f:facet name="output"><h:outputText value="#{userTip.winnerTip}"/></f:facet> 
        <f:facet name="input"> 
         <p:selectOneMenu id="winnerTipInput#{round}" 
             disabled="#{tippingViewBean.tipIsClosed(userTip)}" 
             value="#{tippingViewBean.winnerTip}" style="width: 100%"> 
          <f:selectItems value="#{tippingViewBean.winnerTipForSelection}" var="selectItem" 
              itemLabel="#{selectItem}" itemValue="#{selectItem}"/> 
         </p:selectOneMenu> 
        </f:facet> 
       </p:cellEditor> 
      </p:column> 
      <p:column headerText="2,5 Gól alatt/felett"> 
       <p:cellEditor> 
        <f:facet name="output"><h:outputText value="#{userTip.twoAndHalfTip}"/></f:facet> 
        <f:facet name="input"> 
         <p:selectOneMenu id="goalsTipInput#{round}" 
             disabled="#{tippingViewBean.tipIsClosed(userTip)}" 
             value="#{tippingViewBean.goalsTip}" style="width: 100%"> 
          <f:selectItems value="#{tippingViewBean.goalsTipForSelection}" var="goalsSelectItem" 
              itemLabel="#{goalsSelectItem}" itemValue="#{goalsSelectItem}"/> 
         </p:selectOneMenu> 
        </f:facet> 
       </p:cellEditor> 
      </p:column> 

     </p:dataTable> 

    </p:tab> 

</p:tabView> 

Ce que je fais mal?

Répondre

0

Ok, j'ai trouvé la réponse. J'ai changé le widgetVar de dataTable en unique (cellTips # {round}), et cela fonctionne.