0
votes

I have the next issue, i upload some data from a datatable, when the process is complete it appears a p:dialog that shows me records that has a mistake. When i click the p:commandbutton "ok!" it must clear all the list (this process I checked on debug mode and it clears it) but the datatable called "sellosTable" it doesn't get updated, i tried so many alternatives that i have found on stack.

            <p:panel id="pnlMayor">
                <h:form id="frm" enctype="multipart/form-data">

                    <p:dataTable id="sellosTable" value="#{cargarSellosBean.listadoSellos}" var="sellos" widgetVar="sellTable" paginator="true" rows="10"
                                 paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                                 paginatorPosition="bottom" filteredValue="#{cargarSellosBean.filteredSellos}" 
                                 rowStyleClass="#{sellos.repeated.equals('repetido')?'rowbackgorundOnRepeated':''}"
                                 rowsPerPageTemplate="5,10,15"  lazy="false" 
                                 selection="#{cargarSellosBean.selectedSellos}" rowKey="#{sellos.secuencial}" style="margin-bottom:0">

                        <p:column selectionMode="multiple" style="text-align: center"/>

                        <p:column headerText="Sellos" filterBy="#{sellos.inv_sello}" filterStyle="display:none" filterMatchMode="contains">
                            <h:outputText value="#{sellos.inv_sello}"/>
                        </p:column>
                        <p:column headerText="N° Seguridad" filterBy="#{sellos.inv_seguridad}" filterStyle="display:none" filterMatchMode="contains">
                            <h:outputText value="#{sellos.inv_seguridad}"/>
                        </p:column>
                        <p:column headerText="Indicador" filterBy="#{sellos.repeated}" filterStyle="display:none" filterMatchMode="contains">
                            <h:outputText value="#{sellos.repeated}"/>
                        </p:column>

                    </p:dataTable>

                    <p:commandButton id="guardarSellos" style="position: relative; left: 450px; top: 5px; width: 20%" value="Guardar" 
                                     actionListener="#{cargarSellosBean.guardarListadoSellos()}"
                                     oncomplete="PF('failBox').show();" update="failsDialog"
                                     />


                    <p:dialog id="basicDialog" resizable="false" header="Por favor espere...." widgetVar="dlg2" modal="true" closable="false" onShow="startProgressBar();">           
                        <p:progressBar id="progressBarLoad" widgetVar="pbClient" style="width:300px" />   
                    </p:dialog>

                    <p:blockUI block="pnlMayor" trigger="guardarSellos" />
                </h:form>

                <p:dialog id="failsDialog" resizable="false" header="Informe de Registros Fallidos" widgetVar="failBox" modal="true"
                          closable="true" closeOnEscape="true">   
                    <h:form id="frmDialog">
                        <p:dataTable id="tblFailSellos" value="#{cargarSellosBean.failedSellosList}" var="failed" widgetVar="sellTable" paginator="true" rows="5"
                                     paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                                     rowsPerPageTemplate="5,10,15" lazy="false" paginatorPosition="bottom" style="width:600px;height: 300px">
                            <p:column headerText="Sello">
                                <h:outputText value="#{failed.inv_sello}"/>
                            </p:column>
                            <p:column headerText="N° Seguridad">
                                <h:outputText value="#{failed.inv_seguridad}"/>
                            </p:column>
                        </p:dataTable>
                        <p:commandButton style="position: relative; left: 450px; top: 5px; width: 20%" value="Ok!"
                                         actionListener="#{cargarSellosBean.clearFailedList()}"
                                         update="@all"
                                         oncomplete="PF('failBox').hide();">
                        </p:commandButton>
                    </h:form>
                </p:dialog>
            </p:panel>

Any suggestion?

1
Can you reduce your code to a minimal reproducible example? - Kukeltje
@Kukeltje Done, if you need a little bit more explained, i can make in parts. - Jorge
So it works if you remove the <f:facet name="header"> from the first datatable? - Kukeltje
@Kukeltje No, it doesn't and i need that header, because i use to filter the data of the datatable. - Jorge
everthing that is not relevant for the problem should be removed. Facets, paginator templates, sorting, filtering etc... and a bean (also minimal, complete, ...) would help to. Only then can others try to reproduce if not directly obvious - Kukeltje

1 Answers

0
votes

Just a guess, but try explicitly updating the datatable like this update="@([id$=sellosTable])"