1 Reply Latest reply on Sep 7, 2007 10:01 AM by akira_ag

    How to select several rows and perform an action on all sele

    jeje47

      Hi,

      I have a datatable with rows composed with a checkbox (to perform the row selection) and data. I would like to select several rows (by clicking on the corresponding checkboxes) and call an action method on the datatable with all the selected rows. I've made a try but i use the binding tag of the datatable. Is there an issue to do this without component binding? (getRowIndex return only one selected line)

      Thanks in advance

        • 1. Re: How to select several rows and perform an action on all

          Yes, you can do:

          <h:form>
          <rich:datatable ... var="item">
          ...
          <rich:row>
          <h:selectBooleanCheckbox value="#{MyBean.forActionCollection[item.id]"/>
          </rich:row>
          ...
          </h:form>
          </h:form>
          


          and MyBean:

          public class MyBean {
          ...
          private Collection<Integer,Boolean> forActionCollection = new ArrayList<Integer,Boolean>();
          
          ...
          }