title: PrimeFaces get all row value of datatable
body: <p>I am new for prime face. I had a checkbox and textbox value on dataTable.And dataTable will load data from database. Please see my code below</p>
  
  <p>text.xhtml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:c="http://java.sun.com/jstl/core"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"&gt;
  &lt;ui:composition template="../templates/layout.xhtml"&gt;
    &lt;ui:define name="metadata"&gt;
      &lt;f:metadata&gt;
        &lt;f:event type="preRenderView" listener="#{kooBean.initEdit}" /&gt;
      &lt;/f:metadata&gt;
    &lt;/ui:define&gt;
    &lt;ui:define name="content"&gt;
      &lt;h:form prependId="false" id="growlForm"&gt;
        &lt;p:growl id="growl" showDetail="#{applicationBean.isShowDetailMessage()}" /&gt;
      &lt;/h:form&gt;
  
  
  
      &lt;h:form id="form"&gt;  
  
      &lt;p:dataTable id="list" value="#{kooBean.model}" lazy="true" var="kooTable" 
      rendered="#{kooBean.dataVisible}"  paginatorTemplate=" {CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" 
      rowsPerPageTemplate="5,10,25,50" rows="10" sortBy="#{kooTable.id}"  selection="#{kooBean.selectedCars}"
      rowKey=" #{kooTable.id}"&gt;
  
  
         &lt;f:facet name="header"&gt;
              Checkbox Based Selection
          &lt;/f:facet&gt;
  
              &lt;p:column selectionMode="multiple"  style="width:10%;text-align:center" /&gt;
              &lt;p:column headerText="Description" &gt;
                  #{kooTable.description}
                  &lt;p:inputText value=" #{kooTable.param_str}" /&gt;
              &lt;/p:column&gt;
  
              &lt;f:facet name="footer"&gt;  
              &lt;p:commandButton id="multiViewButton" value="View" icon="ui-icon-search"  
               update=":form:displayMulti" oncomplete="multiCarDialog.show()"/&gt;  
            &lt;/f:facet&gt;  
  
  
           &lt;/p:dataTable&gt;
  
      &lt;/h:form&gt;
  
  
    &lt;/ui:define&gt;
  &lt;/ui:composition&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>bean.java</p>
  
  <pre><code>    package my.com.mesiniaga.sphere.web;
  
  import static my.com.mesiniaga.sphere.domain.KooPredicate.nameLike;
  import my.com.mesiniaga.sphere.domain.KooTable;
  import java.util.Date;
  import java.util.List;
  
  import javax.faces.application.FacesMessage;
  import javax.faces.context.FacesContext;
  
  import org.primefaces.model.LazyDataModel;
  import org.springframework.roo.addon.jsf.managedbean.RooJsfManagedBean;
  import org.springframework.roo.addon.serializable.RooSerializable;
  
  import my.com.mesiniaga.sphere.service.KooService;
  import my.com.mesiniaga.sphere.service.QueryDslSupport;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.UUID;
  
  
  import java.util.Date;
  
  import com.mysema.query.types.Predicate;
  
  
  
  @RooSerializable
  @RooJsfManagedBean(entity = KooTable.class, beanName = "kooBean")
  public class KooBean {
  
      private KooTable kooTable = new KooTable();
  
  
  
      private String attribute;
      private List&lt;String&gt; cols;
      public String userId;
      public String emailNotification;
      private boolean addGroup = false;
      private boolean editGroup = false;
      private boolean addGroupUser = false;
  
      private KooTable selectedCar;  
      private KooTable[] selectedCars;  
  
  
      private final LazyDataModel&lt;KooTable&gt; model = new AbstractQueryDslJpaLazyDataModel&lt;KooTable&gt;() {
  
          @Override
          public Predicate getPredicate(){
  //          LOG.info(getKooTable().getName());
              return nameLike(getKooTable().getDescription());
  
          }
  //      
          @Override
          public QueryDslSupport&lt;KooTable&gt; getQueryDslSupport(){
              return kooService;
          }
      };
  
      public LazyDataModel&lt;KooTable&gt; getModel() {
          return model;
      }
  
      public String getUserId() {
          return userId;
      }
  //
  //  public void setUserId(String userId) {
  //      this.userId = userId;
  //  }
  
      public String getEmailNotification() {
          return emailNotification;
      }
  //
  //  public void setEmailNotification(String emailNotification) {
  //      this.emailNotification = emailNotification;
  //  }
  
      public List&lt;String&gt; getCols() {
          return cols;
      }
  
      public void setCols(List&lt;String&gt; cols) {
          this.cols = cols;
      }
  
      public String getAttribute() {
          return attribute;
      }
  
      public void setAttribute(String attribute) {
          this.attribute = attribute;
      }
  
  
      public boolean isAddGroup() {
          return addGroup;
      }
  
      public void setAddGroup(boolean addGroup) {
          this.addGroup = addGroup;
      }
  
      public boolean isEditGroup() {
          return editGroup;
      }
  
      public void setEditGroup(boolean editGroup) {
          this.editGroup = editGroup;
      }
  
      public boolean isAddGroupUser() {
          return addGroupUser;
      }
  
      public void setAddGroupUser(boolean addGroupUser) {
          this.addGroupUser = addGroupUser;
      }
  
      public void initCreatePage() {
          //Initialize user group listing page
  
          cols = new ArrayList&lt;String&gt;();
          cols.add("id");
          cols.add("description");
  
  //      displayGroupsList();
  
          if (!FacesContext.getCurrentInstance().isPostback()) {
  //          if (FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("edit") != null) {
  //              LOG.info("EDIT....");
  //              attribute = FacesContext.getCurrentInstance().getExternalContext().getRequestHeaderMap().get("referer");
  //              initEdit();
  //              editGroup = true;
  //          } else if (FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("create") != null) {
  //              LOG.info("CREATE....");
  //              addGroup = true;
  //          }
          }
      }
  
  //      
  //  public String displayGroupsList() {
  //      findAllGroupses();
  //      return LIST_NAVIGATION_PAGE;
  //  }
  //  
  //  public String cancelCreateGroup(){
  //      return LIST_NAVIGATION_PAGE;
  //  }
  //  
  //  public String createGroup() {
  //      String message = "";
  //      try {
  //
  //          if (groups.getId() != null) {
  //              //submit response inquiry
  //              
  //              groupsService.responseInquiry(groups);
  //              message = "message_successfully_updated";
  //          } else {
  //              groups.setDescription("none");
  //              groups.setUpdatedby(1L);
  //              groups.setUpdatedon(new Date());
  //              groupsService.create(groups);
  //              message = "message_successfully_created";
  //          }
  //      } catch (NestedRuntimeException e) {
  //          LOG.error(e.getMostSpecificCause().getMessage(), e);
  //          message = "Failed to update";
  //          FacesMessage facesMessage = new FacesMessage(message);
  //          facesMessage.setDetail(e.getMostSpecificCause()
  //                  .getLocalizedMessage());
  //          FacesContext.getCurrentInstance().addMessage(null, facesMessage);
  //          return null;
  //      }
  //      FacesMessage facesMessage = MessageFactory.getMessage(message,
  //              "groups");
  //      FacesContext.getCurrentInstance().addMessage(null, facesMessage);
  //      //      FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true);
  ////        reset();
  //      return LIST_NAVIGATION_PAGE;
  //  }
  
      public void initEdit() {
  
          System.out.println("init edit !");
  //      String groupId = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("groupId");
  //      if (groupId != null) {
  //          addGroupUser = true;
  //          groupsWithTask = groupsService.findGroupsWithTask(Long.valueOf(groupId));
  //          groups = groupsWithTask.getGroups();
  //          if (groupsWithTask.getTask() != null) {
  //              LOG.info("task name = " + groupsWithTask.getTask().getName());
  //          }
  //      } 
      }
  
  
      public boolean isDataVisible() {
          return true;
      }
  
  
  //    public Car[] getSelectedCars() {  
  //        return selectedCars;  
  //    }  
  //    public void setSelectedCars(Car[] selectedCars) {  
  //        this.selectedCars = selectedCars;  
  //    }  
  
  
       public KooTable[] getSelectedCars() {  
              return selectedCars;  
          }  
          public void setSelectedCars(KooTable[] selectedCars) {  
              this.selectedCars = selectedCars;  
          }  
  
          public KooTable getSelectedCar() {  
              return selectedCar;  
          }  
  
          public void setSelectedCar(KooTable selectedCar) {  
              this.selectedCar = selectedCar;  
          }  
  }
  </code></pre>
  
  <p>Here is my question.When I click view button, I need to get every row of value including checkbox value whether checkbox is checked or nt then update to database. Is it possible?</p>