0 Replies Latest reply on Feb 23, 2012 5:07 AM by Christophe CARVALHO

    Rich:dataTable : checkbox selections and built-in filtering

    Christophe CARVALHO Newbie

      Hi,

       

      I want to use checkboxes in my datables to select multiple lines but it seems to be incompatible with the built-in filtering functionnality...

       

      Here is a part of my code :

       

       

      <rich:dataTable id="myList" var="item"
           value="#{objectsList}" footerClass="dataTable_footer" reRender="ds" width="100%"> 
      
            <rich:column>
                  <f:facet name="header">
                       <h:selectBooleanCheckbox title="#{msgsCommon.selectAll}" value="#{gestionaffichage.falseValue}"
                               onclick="checkedAll(this.form.id)" styleClass="select" />
                  </f:facet>
                  <h:selectBooleanCheckbox id="selection" styleClass="select" title="#{msgsCommon.selectionner}"
                           value="#{rowSelection[item]}" />
            </rich:column>
      
            <rich:column styleClass="dataTable_column_left" sortBy="#{item.designation}"
                                    filterMethod="#{myBean.filterDesignation}">
                  <f:facet name="header">
                               <h:panelGroup>
                                    <h:outputText value="Designation" /><br/>
                                    <h:inputText value="#{myBean.designationValue}" id="input" onclick="Event.stop(event);">
                                              <a4j:support event="onkeyup" reRender="myList" ignoreDupResponses="true"
                                                        requestDelay="200" similarityGroupingId="true" />
                                    </h:inputText>
                               </h:panelGroup>
                   </f:facet>
                   <h:outputText value="#{item.designation}" />
             </rich:column>
      
      

       

       

      When i enter any filter value, the filter method is processed before all checkboxes have been submit ... so after filtering, new lines are checked or unchecked according to the value of the previous object at the same line (before filtering).

       

      For example, there is no problem with rich:dataScroller because scrolling is processed after checkboxes submissions.

       

      Is there a way to launch the filter method after all checkboxes submissions (to preserve the integrity of selected lines) ?

       

       

      Best regards,

       

       

      Christophe Carvalho.