2 Replies Latest reply on Jan 27, 2011 8:53 PM by baldercm

    rich:dataTable not able to select rows of different pages

    saurabh0011

      hi,

       

      I have  rich:dataTable with rich:datascroller. i am not able to select rows of different pages before submit the form. meaning is if i select a row of page one and scroll to another page then selected row make uncheck.

       

      code:

       

       

      <rich:dataTable  id="dt1" value="#{tableBean.lst}" var="item" rendered="#{tableBean.randerUserContacts}" border="0" >

                                                      <f:facet name="header">

                                                              <h:outputText value="#{tableBean.usrName}#{msg.totalContacts} #{tableBean.totalContacts}" />

                                                      </f:facet>                               

                                                      <rich:column  width="50px" label="Check">

                                                              <f:facet name="header">

                                                                  <h:outputText value="Chk" />

                                                            </f:facet>                                                       

                                                             <h:selectBooleanCheckbox id="t1" value="#{item.chk}" />

                                                     </rich:column>                           

                                                      <rich:column sortable="true" sortBy="#{item.usrName}" filterBy="#{item.usrName}" filterEvent="onkeyup"

                                                                  width="300px" label="#{msg.contName}">

                                                              <f:facet name="header">

                                                                  <h:outputText value="#{msg.contName}"/>

                                                              </f:facet>

                                                              <h:outputText value="#{item.usrName}"></h:outputText>

                                                              <f:facet name="footer" ><h:outputText value="#{msg.contName}" /></f:facet>

                                                      </rich:column >     

                                                      <f:facet name="footer"  >

                                                               <rich:datascroller  id="ds" reRender="txt" />                                           

                                                      </f:facet>       

       

                                                  </rich:dataTable> 

       

       

      please help, how can i able to select different page rows before submit my form.

       

      Thanks             

        • 1. rich:dataTable not able to select rows of different pages
          ilya40umov
          • 2. rich:dataTable not able to select rows of different pages
            baldercm

            Hi

             

            I guess you can try doing something like that:

             

                .....

                 <!-- Update model on checkbox click -->

                 <h:selectBooleanCheckbox id="myId" value="#{item.chk}">

                      <a4j:support event="onclick"

                                actionListener="#{myController.toggleItemSelectedActionListener}"

                                ajaxSingle="true">

                           <f:param name="itemId" value="#{item.id}" />

                      </a4j:support>

                 </h:selectBooleanCheckbox>

                 .....

                 <!-- Global process action outside the table -->

                 <a4j:commandButton value="Process selected rows"

                           actionListener="#{myController.proccessSelectedRowsActionListener}"

                           ajaxSingle="true" />

             

            or any other way to update the model on checkbox click and process checked rows on a different action.

             

            I haven't tested the code, it's just a possible solution that came to my mind. Hope it can be useful.