0 Replies Latest reply on Feb 12, 2008 4:51 AM by Thiagu Mariappan

    selectBooleanCheckbox  within dataTable is deselected across

    Thiagu Mariappan Novice

      i need check box component within each dataTale rows.
      I need to display what are all the rows to be selected at the time of show Rows command button clicked
      This is my xhtml sample code

      <a4j:form id="form" reRender="table-body" ajaxSubmit="true" ignoreDupResponses="true" requestDelay="500">
      <a4j:region id="stat1">
      <a4j:outputPanel id="table-body">
      <rich:dataTable id="prodList" rows="10" value="#{productlist}" var="product">
       <f:facet name="header">
       <h:outputText value="Select" />
       <h:outputText value="Model" />
       <h:selectBooleanCheckbox value="#{searchSelections[product]}"/>
       <h:outputText value="#{product.productName}" />
      <rich:datascroller for="prodList" maxPages="10" />
      <h:commandButton value="Show Rows" action="#{productsearch.showRows}"/>

      This is my session bean class code
      public class ProductsAction implements ProductsLocal,Serializable
       EntityManager em;
       Map<TblProducts, Boolean> searchSelections;
       static List<TblProducts> productlist;
       public String init() {
      productlist =em.createQuery("select t from TblProducts t").getResultList();
      searchSelections=new HashMap<TblProducts, Boolean> ()
       public String showRows() {
      for (TblProducts item: productlist)
       Boolean selected = searchSelections.get(item);
       if (selected!=null && selected)
       System.out.println("Selected row is :"+ item.getProductName());

      this code is workes fine within the single page,
      selectBooleanCheckbox is deselected if I try use datascroller
      How to resolve this problem