5 Replies Latest reply on Apr 6, 2010 10:53 AM by ilya_shaikovsky

    save rich:datatable data

    dejela

      HI!

       

      I have this code :

      <a4j:keepAlive beanName="bJobDetailsBean" />

      <h:form>       

              <rich:dataTable  rows="7" value="#{bJobDetailsBean.lreqs}"  var="req"

                  id="reqs" width="630px" binding="#{bJobDetailsBean.table}" >

       

       

                  <rich:column label="Value" styleClass="schColL" width="90px"

                      style="text-align:center">
                      <f:facet name="header">
                          <h:outputText value="#{bJobDetailsBean.colValue}" />
                      </f:facet>
                      <h:inputText value="#{req.value}" immediate="true">
                      </h:inputText>
                  </rich:column>
              </rich:dataTable></div>
              <a4j:commandButton value="Save"
                  action="#{bJobDetailsBean.saveChanges}" ></a4j:commandButton>
          </h:form>

       

      with the bean:

      private List<JobBookingDetail> lreqs;

      public List<JobBookingDetail> getLreqs() {
              return lreqs;
          }

          public void setLreqs(List<JobBookingDetail> lreqs) {
              this.lreqs = lreqs;
          }

       

      public String saveChanges() {
                   
              System.out.println(lreqs.get(0).getValue());
         
          }

       

      the value of lreqs is never being saved! even if the user had entered a different data!