13 Replies Latest reply on Apr 6, 2011 3:51 AM by ilya_shaikovsky

    RangeFilter is called recursively

    murali.sundaram

      Good Day,

       

      I have added a checkbox in the table for selection of a row.When i click on the checkbox, i re-Render the checkbox id.

       

      When ever i click the check box, filter method is called. if i have 1000 records in table, filter method is called 1000 times.Is there any way to stop this, when i select the check box.

       

       

      Note:

      1. Even on the data scroller click this happens

      2. I have used ajaxSingle="true".

       

      Any help would be greatly appreciated.

        • 1. RangeFilter is called recursively
          ilya_shaikovsky

          RF version? if 4.0 CR - need to use snapshots. we already fixed that.

          • 2. RangeFilter is called recursively
            murali.sundaram

            Thanks for your reply.

             

            I'm using 3.3.1.GA.  , Is there any work around to fix this issue in 3.3.1.GA ?

             

            Thanks

            Murali.

            • 3. RangeFilter is called recursively
              ilya_shaikovsky

              to check with 3.3.3.Final And postthe code if upgrade not helps.

              • 4. RangeFilter is called recursively
                murali.sundaram

                Hi Ilya Shaikovsky,

                Even after using 3.3.3 final, i got the same issue, I have attached the code for the same.

                 

                <rich:dataTable id="PerfStatsTable" value="#{perfStatsBean.listToBeUsed}"

                   var="perfstatsList">

                   

                    <rich:column>

                        <f:facet name="header">

                         <acsc:hOutputText value="Select" />

                       </f:facet>

                      <h:selectBooleanCheckbox id="selectRow" name="selectRow"

                        value="#{perfstatsList.selection}">

                         <a4j:support event="onclick" reRender="selectRow"

                         ajaxSingle="true" />

                     </h:selectBooleanCheckbox>

                       </rich:column>

                 

                      <rich:column align="right" filterMethod="#{perfStatsBean.filterAction}">

                    <f:facet name="header">

                      <h:inputText value="#{perfStatsBean.value}" id="input">

                      <a4j:support event="onkeyup" reRender="PerfStatsTable"  ignoreDupResponses="true"      requestDelay="700" oncomplete="setCaretToEnd(event);" />

                    </h:inputText>

                 

                    </f:facet>

                   

                    <acsc:hOutputText value="#{perfstatsList.count}" />

                    </rich:column>

                </rich:dataTable>

                 

                    public boolean filterAction(Object current) {

                       

                        if(StringUtils.isBlank(this.value))

                            return true;

                        PerfStats perfStats = (PerfStats) current;

                       

                        if(perfStats.getCount() > Integer.parseInt(value))

                            return true;

                        else

                            return false;

                   

                    }

                 

                 

                    public boolean filterAction(Object current) {
                       
                        if(StringUtils.isBlank(this.value))
                            return true;
                        PerfStats perfStats = (PerfStats) current;
                       
                        if(perfStats.getCount() > Integer.parseInt(value))
                            return true;
                        else
                            return false;
                   
                    }
                • 5. RangeFilter is called recursively
                  ilya_shaikovsky

                  doh.. thought about some kind of simple action (becuase just solved such one in RF 4) But your case is different. #{perfStatsBean.filterAction} - really will be called for every row when constructing the model. Table using it to get real model state considering current filtering every time you make submit processing the table or inner components.

                  • 6. RangeFilter is called recursively
                    murali.sundaram

                    Thanks for your reply,

                     

                    Is there any way to stop this  in 3.1.1 or 3.3.3?,  I'm ready to change my action (#{perfStatsBean.filterAction}) to avoid this issue.

                    • 7. RangeFilter is called recursively
                      nbelaevski

                      Hi Murali,

                       

                      Any operation that involves table processing (such as action component decoding or row encoding) operates over filtered/sorted model, thus sorting and filtering is being done on the subsequent request. Is it posible for you to remove ajax request functionality for checkbox?

                      • 8. RangeFilter is called recursively
                        murali.sundaram

                        Hi Nick, Thanks for your response.

                         

                        We used this a4j to retain the check box selection on pagination.

                         

                        Is there any other way we can retain the check box selection on pagination (Datascroller).  without using the a4j inside the table ,

                         

                        Thanks

                        Murali.

                        • 9. RangeFilter is called recursively
                          nbelaevski

                          Murali,

                           

                          You can add data table into 'execute' for data scroller, so that table will be saved when page is switched.

                          • 10. RangeFilter is called recursively
                            murali.sundaram

                            Thanks Nick,

                            I'm not sure on how to add data table into 'execute' for datascroller,  Can you please provide any sample code or any link i can refer to.

                             

                            Thanks

                            Murali

                            • 11. RangeFilter is called recursively
                              nbelaevski

                              Add execute="PerfStatsTable" for rich:datascroller.

                              • 12. RangeFilter is called recursively
                                murali.sundaram

                                Hi Nick ,

                                     I have added execute, but still the selection is not retained. Below is the piece of code.

                                 

                                    <rich:dataScroller id="dsPerfStatsTable"for="PerfStatsTable" execute="PerfStatsTable"

                                           ajaxSingle="true"oncomplete="evenRow();activeRowMouseOver();activeRowMouseOut();"

                                           rendered="#{perfStatsBean.rpgPerfList != null}" />

                                 

                                Note: I have tried it in both 3.3.1.GA and 3.3.3.

                                 

                                 

                                 

                                Thanks

                                Murali

                                • 13. RangeFilter is called recursively
                                  ilya_shaikovsky

                                  Nick mentioned attribute from 4.x in 3.3.3 it was named process