0
votes

I am using JSF 2.2 with PrimeFaces 5.0. I have a dataTable with cell-editing.

I am having problems with the dataTable inside dialog when I set editMode="cell", the outputtext after editing it's doesn't appear, but when i put the datatable edit outside dialog, it's work.When I inspect the element of datatable <div class="ui-cell-editor-output" style="display: none;"></div> it's empty but if i put the datatable edtor outside dialog the outPut element isn't empty

Let me explain with some code:

<p:dialog  id="modif" width="80%" widgetVar="w_edit" modal="true" >                    
        <p:tabView  > 
            <p:tab  title="Controle de Réception ">                  
                <h:panelGrid>
                    <p:dataTable id="data1" value="#{normeMicroEBean.listOfNorme(lotRecpBean.currentLotReception.entrant)}" 
                                 var="item" editable="true" editMode="cell" >                           
                        <p:column headerText="Valeur Controle" styleClass="ui-editable-column"> 
                            <p:cellEditor>
                                <f:facet name="output"><h:outputText  value="#{item.valeurControle}" /></f:facet>
                                <f:facet name="input"><p:inputText id="modelInput" value="#{item.valeurControle}" style="width: 50%"/></f:facet>
                            </p:cellEditor>                               
                        </p:column>
                        <p:column width="15%" headerText="Testeur">
                            <p:cellEditor >
                                <f:facet name="output"><h:outputText value="#{item.testeurCR.nom}" /></f:facet>
                                <f:facet name="input">
                                    <h:selectOneMenu value="#{item.testeurCR.nom}" style="width:50%">
                                        <f:selectItems value="#{personnelBean.liste}"   var="perso" itemLabel="#{perso.nom}" itemValue="#{perso}" />
                                    </h:selectOneMenu>
                                </f:facet>
                            </p:cellEditor>
                        </p:column>                                                        
                    </p:dataTable>
                </h:panelGrid>      
            </p:tab>    
        </p:tabView> 
    </p:dialog> 

I hope (like always) any of you could save me again.

3

3 Answers

0
votes

All user input must be inside of a form. You'll need an <h:form> inside the dialog.

0
votes

I still have the same problem when i modify the row in datatable editor inside dialog the outputtext doesn't change still have the old value ,but when i put this datatable in simple page work

    <p:dialog  id="modif" width="80%" widgetVar="w_edit" modal="true" >                    
        <p:tabView  > 
            <p:tab  title="Controle de Réception ">                  
                <h:form>
                   <h:panelGrid>                      
                    <p:dataTable id="data1" value="#{normeMicroEBean.listOfNorme(lotRecpBean.currentLotReception.entrant)}" 
                                 var="item" editable="true" editMode="cell" >                           
                        <p:column headerText="Valeur Controle" styleClass="ui-editable-column"> 
                            <p:cellEditor>
                                <f:facet name="output"><h:outputText  value="#{item.valeurControle}" /></f:facet>
                                <f:facet name="input"><p:inputText id="modelInput" value="#{item.valeurControle}" style="width: 50%"/></f:facet>
                            </p:cellEditor>                               
                        </p:column>
                        <p:column width="15%" headerText="Testeur">
                            <p:cellEditor >
                                <f:facet name="output"><h:outputText value="#{item.testeurCR.nom}" /></f:facet>
                                <f:facet name="input">
                                    <h:selectOneMenu value="#{item.testeurCR.nom}" style="width:50%">
                                        <f:selectItems value="#{personnelBean.liste}"   var="perso" itemLabel="#{perso.nom}" itemValue="#{perso}" />
                                    </h:selectOneMenu>
                                </f:facet>
                            </p:cellEditor>
                        </p:column>                                                        
                    </p:dataTable>
                </h:panelGrid>
             <h:form>
            </p:tab>  
          <p:tab  title="Info lot de Réception">                   
                <h:form>    
                    <p:panelGrid id="idPanel">                                                                                                        
                        <p:row>
                            <p:column><p:outputLabel value="QuantiteLivree:"                   for="quantiteLivree" /></p:column>
                            <p:column><p:inputText id="quantiteLivree" value="#{lotRecpBean.currentLotReception.quantiteLivree}" title="QuantiteLivree" /></p:column>
                            <p:column><p:outputLabel  value="QuantiteRecue:" for="quantiteRecue" /></p:column>
                            <p:column><p:inputText id="quantiteRecue" value="#{lotRecpBean.currentLotReception.quantiteRecue}" title="QuantiteRecue" /></p:column>
                            <p:column><p:outputLabel value="NumBonLivraison:" for="numBonLivraison" /></p:column>
                            <p:column><p:inputText id="numBonLivraison" value="#{lotRecpBean.currentLotReception.numBonLivraison}" title="NumBonLivraison" /></p:column>                          
                        </p:row>                                                                                                                                    
                    </p:panelGrid>                        
                    <div>
                        <p:commandButton action="#{lotRecpBean.update()}" value="Enregistrer" styleClass="button"
                                         style="float: right" oncomplete="PF('lotRecepTable').filter();PF('w_edit').hide();" />               
                    </div>  
                </h:form>
            </p:tab>    
        </p:tabView> 
    </p:dialog> 
0
votes

I fixed the problem , it's come from the value of datatable ===> the value of datatable editor must be a list and not a method which return a list datatable editor work just with a list 1-

 <p:dataTable id="data1" value="#{normeMicroEBean.listOfNorme}" 
                             var="item" editable="true" editMode="cell" >  

I create a list in the managed bean t and in the button i execute the method to full the list created in the managed bean . thank you for your response