编辑单元格后无法更新p:dataTable

时间:2018-08-13 15:46:45

标签: jsf primefaces omnifaces

在触发cellEdit方法后,我试图更新我的datable页脚。我阅读并测试了这篇文章,但没有成功Updating entire <p:dataTable> on complete of <p:ajax event="cellEdit">

已触发cellEdit方法,但它不会更新数据表。即使在cellEdit方法中,我也使用omnifaces Ajax.update(“ ID”); 方法,但它不会更新 这是我的数据表xhtml文件

controller

这是我的cellEdit方法

<p:dataTable id="brouiDtable" widgetVar="brouillard" var="broui" editMode="cell"
                                         value="#{brouillardManagedBean.brouillards}" selection="#{brouillardManagedBean.selectedBrouillard}"
                                         rowKey="#{broui.numLigne}"
                                         rowIndexVar="indexStatusList"
                                         editable="true" style="margin-bottom:20px">

                                <p:ajax event="rowEdit" listener="#{brouillardManagedBean.onRowEdit}" update=":saisie:msgs,:saisie:brouiDtable" process=":saisie:brouiDtable" />
                                <p:ajax event="rowEditCancel" listener="#{brouillardManagedBean.onRowCancel}" update=":saisie:msgs,:saisie:brouiDtable" process=":saisie:brouiDtable"/>
                                <p:ajax event="cellEdit" listener="#{brouillardManagedBean.onCellEdit}" update=":saisie:brouiDtable" />

                                <p:column headerText="#" style="width:3%">
                                    #{indexStatusList+1}
                                </p:column>
                                <p:column style="width:32px">
                                    <p:commandButton process="@this,:saisie:brouiDtable" update=":saisie:msgs,:saisie:brouiDtable" icon="fa fa-trash Fs20 white"
                                                     actionListener="#{brouillardManagedBean.onRemoveNew(broui)}" />
                                </p:column>
                                <p:column headerText="Compte du grand livre">
                                    <p:cellEditor>
                                        <f:facet name="output"><h:outputText value="#{broui.souscompte.codeIntituleFr()}" /></f:facet>
                                        <f:facet name="input">
                                            <p:autoComplete  completeMethod="#{brouillardManagedBean.completeText}" value="#{broui.souscompte}" cache="true"
                                                             var="sCompte"  itemLabel="#{sCompte.codeIntituleFr()}" tabindex="1"  maxResults="10"
                                                             dropdown="true" dropdownMode="current" converter="sousCompteConverter"
                                                             itemValue="#{sCompte}"  forceSelection="true">
                                                <p:ajax event="itemSelect" listener="#{brouillardManagedBean.onItemSelect}" update=":saisie:msgs" />
                                            </p:autoComplete>
                                        </f:facet>
                                    </p:cellEditor>
                                </p:column>

                                <p:column headerText="Libelle">
                                    <p:cellEditor>
                                        <f:facet name="output"><h:outputText value="#{broui.libelle}" /></f:facet>
                                        <f:facet name="input"><p:inputText value="#{broui.libelle}" tabindex="2" style="width:100%" label="Libellé"/></f:facet>
                                    </p:cellEditor>
                                </p:column>
                                <p:column headerText="Débit" width="150">
                                    <p:cellEditor>
                                        <f:facet name="output"><p:inputNumber value="#{broui.debit}" /></f:facet>
                                        <f:facet name="input">
                                            <p:inputNumber value="#{broui.debit}" tabindex="3" emptyValue="zero" style="width:100%" label="Débit" >
                                                <p:ajax event=""
                                            </p:inputNumber>
                                        </f:facet>
                                    </p:cellEditor>
                                </p:column>
                                <p:column headerText="Crédit" width="150">
                                    <p:cellEditor>
                                        <f:facet name="output"><p:inputNumber value="#{broui.credit}" /></f:facet>
                                        <f:facet name="input">
                                            <p:inputNumber value="#{broui.credit}" tabindex="4" emptyValue="zero" style="width:100%" label="Crédit">
                                            </p:inputNumber>
                                        </f:facet>
                                    </p:cellEditor>
                                </p:column>


                                <p:column style="width:40px">
                                    <f:facet name="header">
                                        <p:commandButton process="@this,:saisie:brouiDtable" update=":saisie:msgs,:saisie:brouiDtable" icon="fa fa-plus"
                                                         actionListener="#{brouillardManagedBean.onAddNew()}"/>
                                    </f:facet>
                                </p:column>
                                <p:columnGroup id="foot" type="footer">
                                    <p:row>
                                        <p:column footerText="Totals: " colspan="4" style="text-align:right;background-color: white; color: #04838f; font-size: 16px;font-weight: bold;width: 150px;"/>
                                        <p:column footerText="#{brouillardManagedBean.totDebit}"  style="background-color: white; color: #04838f; font-size: 16px;font-weight: bold;width: 150px;"/>
                                        <p:column footerText="#{brouillardManagedBean.totCredit}" style="background-color: white; color: #04838f; font-size: 16px;font-weight: bold;width: 150px;" />
                                    </p:row>
                                    <p:row>
                                        <p:column footerText="Solde: " colspan="4" style="text-align:right;background-color: white; color: #04838f; font-size: 16px;font-weight: bold;width: 150px;"/>
                                        <p:column footerText="#{brouillardManagedBean.soldeDebit}" style="background-color: white; color: #04838f; font-size: 16px;font-weight: bold;width: 150px;" />
                                        <p:column footerText="#{brouillardManagedBean.soldeCredit}" style="background-color: white; color: #04838f; font-size: 16px;font-weight: bold;width: 150px;"/>
                                    </p:row>
                                </p:columnGroup> 
                            </p:dataTable>

谢谢帮助

0 个答案:

没有答案