3 Replies Latest reply on Apr 12, 2010 11:03 AM by Charleen Miguel

    h:selectBooleanCheckbox does not work on rich:dataTable with rich:dataScroller

    Charleen Miguel Novice

      Hi -


      I have gone through and searched on this topic and haven't found a solution that works for me, so hopefully someone will be able to help me out. I have an editable dataTable that is reused in several places within my application, and each row contains columns with h:selectBooleanCheckbox, h:outputText, and h:selectOneMenu elements.  When this table is included in a single jsp, scrolling from page 1 -> page 2 -> page 1 retains all of my changes correctly.  However, when this table is included in a jsp which is included in another jsp, scrolling from page 1 -> page 2 -> page 1 loses all of my changes on page 1.  Page 2 retains the changes.  So here are snippets of my code:




      <rich:dataTable value="#{employeeList}" var="employee" rows="20">


         <h:selectBooleanCheckbox value="#{companyBean.selectedIds[employee.id]}"/>




          <h:outputText value="#{employee.lastName}"/>



          <h:outputText value="#{employee.firsttName}"/>



          <h:outputText value="#{employee.middleName}"/>




          <h:selectOneMenu value="#{employee.status}">

             <f:selectItem itemLabel="Single" itemValue="0"/>

             <f:selectItem itemLabel="Married" itemValue="1"/>

             <f:selectItem itemLabel="Divorced" itemValue="2"/>

             <f:selectItem itemLabel="Widowed" itemValue="3"/>



        <f:facet name="footer">

         <rich:dataScroller id="sc" ajaxSingle="false" renderIfSinglePage="false" />





      In this form, there is only one include, so when changes are made to the rows and the user scrolls to subsequent pages, the changes are retained.




      <c:set var="employeeList" value="#{companyBean.employees}"/>

      <@include file="/employees/employeeTable.jsp" %>



      In this form, the company.jsp is included which includes the table.jsp and this is where it breaks.  Changes made to page 1 - and ONLY page 1- are lost. If changes are made on pages 2 or 3 or 4, etc, they are retained.  However, when the user goes back to page 1, the changes are lost.




      <a4j:repeat var="companyBean" value="#{orgBean.companyList}">

        <%@include file="/company.jsp" %>




      Hope this makes sense to someone.  Any help would be greatly appreciated.