Export to GitHub

primefaces - issue #8199

Datatable values are not passing to Backing bean after applying filter


Posted on Jun 24, 2015 by Massive Lion

I have a xhtml page where I am using the "filterBy" funtion of primefaces in Datatable. The list displaying values for my front end gets updated if i don't use filtering and not if I use filtering.

The code for my datatable is: <p:panel headerClass="fHeader" style="width:98%;" header="#{label.locationListHeader}" styleClass="mySubPanelStyle" id="locationTable"> <c:forEach var="policyNokey" items="${locationHandler.policyNoKeyList}" varStatus="rowCounter">

                        &lt;p:panel  header=&quot;Policy Number : #{locationHandler.certPolicyMap[policyNokey].partialPolicy.policyNumber}&quot;&gt;
                            &lt;div&gt;&lt;p:dataTable var=&quot;certInfo&quot; rowIndexVar=&quot;rowIndex&quot;  widgetVar=&quot;dataTableWidgetVar&quot;
                                paginatorAlwaysVisible=&quot;false&quot; style=&quot;width:100%&quot;
                                value=&quot;#{locationHandler.masterLocationList[policyNokey]}&quot;
                                rows=&quot;#{label.locationList_defaultNumberOfRows}&quot;
                                paginatorTemplate=&quot;{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}&quot;
                                rowsPerPageTemplate=&quot;#{label.locationList_numberOfRows}&quot;
                                paginator=&quot;true&quot;&gt;

                                &lt;p:column style=&quot;text-align:left;white-space:normal;vertical-align:top;width:5%;&quot;&gt;
                                    &lt;f:facet name=&quot;header&quot;&gt;
                                        &lt;h:outputText value=&quot;#{label.selectLocation}&quot; /&gt;
                                    &lt;/f:facet&gt;
                                    &lt;h:selectBooleanCheckbox id=&quot;locationSelection&quot; disabled=&quot;#{certInfo.selectableLocation}&quot;
                                        value=&quot;#{certInfo.selectedLocation}&quot; class=&quot;locSelection&quot; &gt;
                                        &lt;f:ajax execute=&quot;@this&quot;
                                            listener=&quot;#{locationHandler.selectAllSOIs}&quot;
                                            render=&quot;InsurenceList InsurenceListNEW&quot; /&gt;
                                        &lt;f:attribute name=&quot;modifiedLoc&quot; value=&quot;#{certInfo}&quot; /&gt;
                                    &lt;/h:selectBooleanCheckbox&gt;
                                    &lt;h:graphicImage url=&quot;/images/icons/red-slash.gif&quot; class=&quot;overrideIcon&quot;
                                        rendered=&quot;#{certInfo.location.overridelocationDetails.overrideInd and certInfo.location.overridelocationDetails.locationInd eq 'Y'}&quot;&gt;
                                        &lt;p:ajax event=&quot;click&quot; update=&quot;ovrdLocInfo&quot;
                                             oncomplete=&quot;overLocDlg.show();&quot;
                                            listener=&quot;#{locationHandler.setSelectedOverLocInfo}&quot; /&gt;
                                        &lt;f:param name=&quot;rowValue&quot; value=&quot;#{policyNokey}+#{rowIndex}&quot; /&gt;

                                    &lt;/h:graphicImage&gt;

                                    &lt;h:graphicImage url=&quot;/images/icons/green.gif&quot; class=&quot;overrideIcon&quot;
                                        rendered=&quot;#{certInfo.location.overridelocationDetails.overrideInd and certInfo.location.overridelocationDetails.locationInd eq 'N'}&quot;&gt;
                                        &lt;p:ajax event=&quot;click&quot; update=&quot;ovrdLocInfo&quot;
                                             oncomplete=&quot;overLocDlg.show();&quot;
                                            listener=&quot;#{locationHandler.setSelectedOverLocInfo}&quot; /&gt;
                                        &lt;f:param name=&quot;rowValue&quot; value=&quot;#{policyNokey}+#{rowIndex}&quot; /&gt;

                                    &lt;/h:graphicImage&gt;
                                &lt;/p:column&gt;

                                &lt;p:column style=&quot;text-align:left;white-space:normal;vertical-align:top;width:11%;&quot;
                                    sortBy=&quot;#{certInfo.coverage.coverageCd}#{certInfo.location.overridelocationDetails.coverageNewValue}&quot;
                                    filterBy=&quot;#{certInfo.coverage.coverageCd}#{certInfo.location.overridelocationDetails.coverageNewValue}&quot; filterStyle=&quot;width:35px&quot; &gt;
                                    &lt;f:facet name=&quot;header&quot;&gt;
                                        &lt;h:outputText value=&quot;#{label.coverage}&quot; /&gt;
                                    &lt;/f:facet&gt;
                                    &lt;h:outputText value=&quot;#{certInfo.coverage.coverageCd}&quot; rendered=&quot;#{!certInfo.location.overridelocationDetails.coverageChangeInd}&quot;/&gt;
                                    &lt;h:outputText value=&quot;#{certInfo.location.overridelocationDetails.coverageNewValue}&quot; rendered=&quot;#{certInfo.location.overridelocationDetails.coverageChangeInd}&quot; style=&quot;font-weight:bold;&quot;/&gt;
                                &lt;/p:column&gt;

                                &lt;p:column style=&quot;text-align:left;white-space:normal;vertical-align:top;width:10%;&quot;
                                    sortBy=&quot;#{certInfo.location.locationNumberInt}&quot;
                                    filterBy=&quot;#{certInfo.location.locationNumber}#{certInfo.location.overridelocationDetails.locNbrNewValue}&quot; filterStyle=&quot;width:35px&quot;&gt;
                                    &lt;f:facet name=&quot;header&quot;&gt;
                                        &lt;h:outputText value=&quot;#{label.locationPremises}&quot; /&gt;
                                    &lt;/f:facet&gt;
                                    &lt;h:outputText value=&quot;#{certInfo.location.locationNumber}&quot; rendered=&quot;#{!certInfo.location.overridelocationDetails.locNbrChangeInd}&quot;/&gt;
                                    &lt;h:outputText value=&quot;#{certInfo.location.overridelocationDetails.locNbrNewValue}&quot; rendered=&quot;#{certInfo.location.overridelocationDetails.locNbrChangeInd}&quot; style=&quot;font-weight:bold;&quot;/&gt;
                                &lt;/p:column&gt;

                                &lt;p:column style=&quot;text-align:left;white-space:normal;vertical-align:top;width:10%;&quot;
                                    sortBy=&quot;#{certInfo.location.com_csc_BldgNumInt}&quot;
                                    filterBy=&quot;#{certInfo.location.com_csc_BldgNum}#{certInfo.location.overridelocationDetails.bldNbrNewValue}&quot; filterStyle=&quot;width:35px&quot;&gt;
                                    &lt;f:facet name=&quot;header&quot;&gt;
                                        &lt;h:outputText value=&quot;#{label.building1}&quot; /&gt;
                                    &lt;/f:facet&gt;
                                    &lt;h:outputText value=&quot;#{certInfo.location.com_csc_BldgNum}&quot; rendered=&quot;#{!certInfo.location.overridelocationDetails.bldNbrChangeInd and !certInfo.location.overridelocationDetails.inqAddLocInd}&quot;/&gt;
                                    &lt;h:outputText value=&quot;#{certInfo.location.overridelocationDetails.bldNbrNewValue}&quot; rendered=&quot;#{certInfo.location.overridelocationDetails.bldNbrChangeInd or certInfo.location.overridelocationDetails.inqAddLocInd}&quot; style=&quot;font-weight:bold;&quot;/&gt;
                                &lt;/p:column&gt;

                                &lt;p:column style=&quot;text-align:left;white-space:normal;vertical-align:top;width:40%;&quot;
                                sortBy=&quot;#{certInfo.location.address.addrOnScreen}#{certInfo.location.overridelocationDetails.desPremisesNewValue}&quot;
                                    filterBy=&quot;#{certInfo.location.address.addrOnScreen}#{certInfo.location.overridelocationDetails.desPremisesNewValue}&quot; filterStyle=&quot;width:350px&quot; filterMatchMode=&quot;contains&quot;&gt;
                                    &lt;f:facet name=&quot;header&quot;&gt;
                                        &lt;h:outputText value=&quot;#{label.address}&quot; /&gt;
                                    &lt;/f:facet&gt;
                                    &lt;h:outputText value=&quot;#{certInfo.location.address.addrOnScreen}&quot; rendered=&quot;#{!certInfo.location.overridelocationDetails.desPremisesChangeInd}&quot;/&gt;
                                    &lt;h:outputText value=&quot;#{certInfo.location.overridelocationDetails.desPremisesNewValue}&quot; rendered=&quot;#{certInfo.location.overridelocationDetails.desPremisesChangeInd}&quot; style=&quot;font-weight:bold;&quot;/&gt;
                                &lt;/p:column&gt;

                                &lt;p:column style=&quot;text-align:left;white-space:normal;vertical-align:top;width:19%;&quot;&gt;
                                    &lt;f:facet name=&quot;header&quot;&gt;
                                        &lt;h:outputText value=&quot;#{label.soi}&quot; /&gt;
                                    &lt;/f:facet&gt;
                                    &lt;h:selectManyCheckbox  styleClass=&quot;ui-reissue-policy-list-table&quot; id=&quot;InsurenceList&quot;
                                        value=&quot;#{certInfo.selectedSOIList}&quot; layout=&quot;pageDirection&quot; rendered=&quot;#{!certInfo.location.overridelocationDetails.selectedSubInsChangeInd}&quot;
                                        &gt;
                                        &lt;p:ajax event=&quot;click&quot; listener=&quot;#{locationHandler.setDummy}&quot; update=&quot;locationTable&quot; &gt;
                                        &lt;f:param name=&quot;Dummy&quot; value=&quot;Test&quot;/&gt;
                                        &lt;/p:ajax&gt;
                                        &lt;f:selectItems value=&quot;#{certInfo.subjectofInsurenceList}&quot;/&gt;
                                    &lt;/h:selectManyCheckbox&gt;
                                    &lt;h:selectManyCheckbox id=&quot;InsurenceListNEW&quot; styleClass=&quot;ui-reissue-policy-list-table&quot;
                                        value=&quot;#{certInfo.location.overridelocationDetails.selectedSub}&quot; layout=&quot;pageDirection&quot; rendered=&quot;#{certInfo.location.overridelocationDetails.selectedSubInsChangeInd}&quot; style=&quot;font-weight:bold;&quot;&gt;
                                        &lt;p:ajax event=&quot;click&quot; listener=&quot;#{policyHandler.setSelectedCoverageCodes1}&quot; process=&quot;@this&quot; update=&quot;locationTable&quot;/&gt;
                                        &lt;f:selectItems value=&quot;#{certInfo.location.overridelocationDetails.subInsNewValue}&quot; /&gt;
                                    &lt;/h:selectManyCheckbox&gt;
                                &lt;/p:column&gt;

                                &lt;p:column style=&quot;text-align:left;white-space:normal;vertical-align:top;width:5%;&quot;&gt;
                                    &lt;f:facet name=&quot;header&quot;&gt;
                                        &lt;h:outputText value=&quot;#{label.location_Action}&quot; /&gt;
                                    &lt;/f:facet&gt;
                                    &lt;p:commandLink value=&quot;#{label.changeLink}&quot; action=&quot;changeLocation&quot;&gt;
                                    &lt;f:setPropertyActionListener value=&quot;#{certInfo}&quot; target=&quot;#{locationHandler.locationDetails}&quot; /&gt;
                                    &lt;f:attribute name=&quot;change&quot; value=&quot;#{certInfo}&quot; /&gt;


                                    &lt;/p:commandLink&gt;
                                &lt;/p:column&gt;
                            &lt;/p:dataTable&gt;&lt;/div&gt;
                        &lt;/p:panel&gt;

                &lt;/c:forEach&gt;


            &lt;/p:panel&gt;
            &lt;br /&gt;
            &lt;div style=&quot;position:relative;bottom:0px;&quot;&gt;&lt;p:commandButton id=&quot;addLocation&quot; value=&quot;#{label.addLocation}&quot;
                action=&quot;addLocation&quot; /&gt;&lt;/div&gt;
            &lt;br /&gt;
        &lt;/p:panel&gt;

        &lt;div align=&quot;center&quot; style=&quot;position:relative;bottom:0px;&quot;&gt;&lt;p:commandButton
            rendered=&quot;#{locationHandler.locationActionCd eq 'add'}&quot;
            id=&quot;continue&quot; value=&quot;#{label.continue}&quot; action=&quot;continue&quot; /&gt;
            &lt;p:spacer width=&quot;10&quot; height=&quot;5&quot; /&gt;
             &lt;p:commandButton rendered=&quot;#{locationHandler.locationActionCd eq 'add'}&quot;
                value=&quot;#{label.close}&quot; onclick=&quot;manageCertClose.show();&quot; ajax=&quot;true&quot;/&gt;         
             &lt;p:spacer
            width=&quot;10&quot; height=&quot;5&quot; /&gt; &lt;p:commandButton
            rendered=&quot;#{locationHandler.locationActionCd eq 'add'}&quot;
            value=&quot;#{label.discard}&quot;
            onclick=&quot;discardCert.show();&quot; /&gt; &lt;p:commandButton
            value=&quot;Accept&quot;
            rendered=&quot;#{locationHandler.locationActionCd eq 'edit'}&quot;
            action=&quot;accept&quot; update=&quot;locationTable&quot;/&gt;&lt;p:spacer width=&quot;10&quot; height=&quot;5&quot; /&gt; &lt;p:commandButton
            id=&quot;cancel&quot; value=&quot;#{label.cancel}&quot; action=&quot;cancel&quot; styleClass=&quot;lastComp&quot;/&gt;&lt;/div&gt;



        &lt;p:spacer width=&quot;1&quot; height=&quot;5&quot; /&gt;

!!! PLEASE USE GITHUB ISSUE TRACKER !!!

https://github.com/primefaces/

Status: Review

Labels:
Priority-Medium Type-NewFeature TargetVersion-FUTURE