8 Replies Latest reply on Mar 1, 2011 12:01 PM by taysay
      • 1. Re: How to use rich: dataTable, rich: subTable, subTable contractions started.
        ilya_shaikovsky

        Simple ajax sample(richfaces-demo main data table page used originally):

         

         

        <h:form>

        <rich:dataTable

        onRowMouseOver="this.style.backgroundColor='#F1F1F1'"

        onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"

        cellpadding="0" cellspacing="0" id="table"

        width="700" border="0" var="record" value="#{report.expReport.records}">

         

        <f:facet name="header">

        //header there

        </f:facet>

         

        <rich:column  colspan="5">

        <a4j:commandLink value="+/-" reRender="table">

        <a4j:actionparam name="shown" value="#{not record.showDetails}" assignTo="#{record.showDetails}"/>

        </a4j:commandLink>

        <h:outputText value="#{record.city}" />

        </rich:column>

         

        <rich:subTable rendered="#{record.showDetails}"

        onRowMouseOver="this.style.backgroundColor='#F8F8F8'"

        onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"

        var="expense" value="#{record.items}">

        <rich:column>

        <h:outputText value="#{expense.day}"></h:outputText>

        <f:facet name="footer">

        <rich:spacer />

        </f:facet>

        </rich:column>

        //more columns there

         

        </rich:subTable>

         

        <f:facet name="footer">

        //footer there

        </f:facet>

         

        </rich:dataTable>

        </h:form>

         

        and showDetails variable added to Record object additionally.

        • 2. Re: How to use rich: dataTable, rich: subTable, subTable contractions started.
          fengxiaofeng

          Thank you very much!

          • 3. How to use rich: dataTable, rich: subTable, subTable contractions started.
            taysay

            Hi  All,

            Please is there anyway I can get to see an example with complete source for backing bean?  I was trying to follow that which is on the richfaces demo page but it doesnt just connect.

            • 4. Re: How to use rich: dataTable, rich: subTable, subTable contractions started.
              taysay

              Hi   ilya,

              Please is thereanyway I can get to see an example with complete source for backingbean?  I was trying to follow that which is on the richfaces demo page  which is similar to what you have here . but it doesnt just connect. the Farthest I could get was to display the data though my subtable was kind of duplicating its self ,

               

              the problem for me really is on these two lines of code from   the .xhtml

               

              width="700" border="0" var="record" value="#{reportsActionBean.churchRecords}">

               

              and

               

              var="expense" value="#{record.items}">

               

               

                 <rich:subTable   .....

               

               

               

              when I try to follow the example with the svn provided code, I get a number format exception  which is thrown when the

                 <rich:subTable  is processed particulary the record.items  method it throws a number format exception.

               

               

               

              but calling the reportsActionBean.churchRecords again for the   subtable rathher duplicates the   subtable.

               

               

               


               

               

               

              Pls see an extract of what I am trying to do below,

               

               

               

               

               

              <ui:composition xmlns="http://www.w3.org/1999/xhtml"

                    xmlns:ui="http://java.sun.com/jsf/facelets"

                    xmlns:h="http://java.sun.com/jsf/html"

                    xmlns:f="http://java.sun.com/jsf/core"

                    xmlns:a4j="http://richfaces.org/a4j"

                    xmlns:rich="http://richfaces.org/rich">

               

                              <rich:dataTable

                                  onRowMouseOver="this.style.backgroundColor='#F1F1F1'"

                                  onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"

                                  cellpadding="0" cellspacing="0"

                                  width="700" border="0" var="church" value="#{reportsActionBean.churchRecords}">

               

                                  <f:facet name="header">

                                      <rich:columnGroup>

                                          <rich:column rowspan="2">

                                              <rich:spacer />

                                          </rich:column>

                                          <rich:column colspan="3">

                                              <h:outputText value="Cell Attendance" />

                                          </rich:column>

                                          <rich:column rowspan="2">

                                              <h:outputText value="subtotals" />

                                          </rich:column>

                                          <rich:column breakBefore="true">

                                              <h:outputText value="Male" />

                                          </rich:column>

                                          <rich:column>

                                              <h:outputText value="Female" />

                                          </rich:column>

                                          <rich:column>

                                              <h:outputText value="Children" />

                                          </rich:column>

                                      </rich:columnGroup>

                                  </f:facet>

               

                                  <rich:column  colspan="5">

                                  <h:outputText value="DEMO" /></rich:column>

               

               

                                  <rich:subTable

                                      onRowMouseOver="this.style.backgroundColor='#F8F8F8'"

                                      onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"

                                      var="details" value="#{reportsActionBean.churchRecords}">

                                      <rich:column>

                                          <h:outputText value="#{details.male}"></h:outputText>

                                          <f:facet name="footer">

                                              <rich:spacer />

                                          </f:facet>

                                      </rich:column>

                                      <rich:column>

                                          <h:outputText value="#{details.female}"><f:convertNumber   pattern="#,###,###"  /></h:outputText>

                                          <f:facet name="footer">

               

                                          </f:facet>

                                      </rich:column>

                                      <rich:column>

                                          <h:outputText value="#{details.children}"><f:convertNumber  pattern="#,###,###"  /></h:outputText>

                                          <f:facet name="footer">

               

                                          </f:facet>

                                      </rich:column>

                                      <rich:column>

                                          <h:outputText value="#{details.firstTimers}"><f:convertNumber   pattern="#,###,###"  /></h:outputText>

                                          <f:facet name="footer">

               

                                          </f:facet>

                                      </rich:column>

                                      <rich:column>

                                          <rich:spacer></rich:spacer>

                                          <f:facet name="footer">

               

                                          </f:facet>

                                      </rich:column>                 

               

                                  </rich:subTable>

               

               

               

                              </rich:dataTable>

               

              </ui:composition>

               

              // managed bean

               

              package com.etranzact.churchPortal.reports.util;

               

               

              import java.math.BigDecimal;

              import java.util.ArrayList;

               

              import java.util.Iterator;

               

              import java.util.List;

               

              import org.jboss.seam.ScopeType;

              import org.jboss.seam.annotations.Name;

              import org.jboss.seam.annotations.Scope;

               

              import com.etranzact.churchPortal.model.ChurchServiceData;

               

              @Name("records")

              @Scope(ScopeType.CONVERSATION)

              public class CellReportRecord {

               

               

               

                      private String city;

               

                      private List items = new ArrayList();

               

                      public String getCity() {

               

                          return city;

               

                      }

               

                      public void setCity(String city) {

               

                          this.city = city;

               

                      }

               

                      public List getItems() {

               

                          System.out.println(": THE ITEM :"+items);

               

                          return this.items;

               

                      }

               

                      public void setItems(List items) {

               

                          this.items = items;

               

                      }

               

               

                      public double getTotalShiloh() {

               

                          double ret = 0.0;

               

                          Iterator it = items.iterator();

               

                          while (it.hasNext()) {

               

                              ChurchServiceData item = (ChurchServiceData) it.next();

               

                              String val = ""+item.getShiloh();

                              if(val ==null || val.trim().equals("")) val = "0.00";

                              ret+=  Double.parseDouble(val);

               

                          }

               

                          return ret;

               

                      }

               

                      /*

                       *

                       * getTotalOthers() returns total sum for shiloh

                       */

               

                      public double getTotalOthers() {

               

                          double ret = 0.0;

               

                          Iterator it = items.iterator();

               

                          while (it.hasNext()) {

               

                              ChurchServiceData item = (ChurchServiceData) it.next();

               

                              String val = ""+item.getOthers();

                              if(val ==null || val.trim().equals("")) val = "0.00";

                              ret+=  Double.parseDouble(val);

               

                          }

               

                          return ret;

               

                      }

               

                      /*

                       *   getTotalOnlineTithe()  returns total online tithe

                       *

                       */

               

               

                      public double getTotalOnlineTithe() {

               

                          double ret = 0.0;

               

                          Iterator it = items.iterator();

               

                          while (it.hasNext()) {

               

                              ChurchServiceData item = (ChurchServiceData) it.next();

               

                              String val = ""+item.getOnlineTithe();

               

                              if(val == null || val.trim().equals(""))  val = "0.00";

               

                              ret+=   Double.parseDouble(val);

               

                          }

               

                          return ret;

               

                      }

               

                      /*

                       *   getTotalCashTithe() returns total cash tithe

                       *

                       */

               

                      public double getTotalCashTithe() {

               

                          double ret = 0.0;

               

                          Iterator it = items.iterator();

               

                          while (it.hasNext()) {

               

                              ChurchServiceData item = (ChurchServiceData) it.next();

               

                              String val = ""+item.getCashTithe();

               

                              if(val == null || val.trim().equals(""))  val = "0.00";

               

                              ret+=   Double.parseDouble(val);

               

                          }

               

                          return ret;

               

                      }

                      /*

                       * getTotalOnlineOffering returns total online offering

                       *

                       */

               

                      public double getTotalOnlineOffering() {

               

                          double ret = 0.0;

               

                          Iterator it = items.iterator();

               

                          while (it.hasNext()) {

               

                              ChurchServiceData item = (ChurchServiceData) it.next();

               

                              String val = ""+item.getOnlineOffering();

               

                              if(val == null || val.trim().equals(""))  val = "0.00";

               

                              ret+=   Double.parseDouble(val);

               

                          }

               

                          return ret;

               

                      }

                      /*

                       *   getTotalCashOffering   returns total cash offering

                       *

                       */

                      public double getTotalCashOffering() {

               

                          double ret = 0.0;

               

                          Iterator it = items.iterator();

               

                          while (it.hasNext()) {

               

                              ChurchServiceData item = (ChurchServiceData) it.next();

               

                              String val = ""+item.getCashOffering();

               

                              if(val == null || val.trim().equals(""))  val = "0.00";

               

                              ret+=   Double.parseDouble(val);

               

                          }

               

                          return ret;

               

                      }

               

               

                      /*

                       *   getNewConverts   returns total new converts

                       *

                       */

                      public int getNewConverts() {

               

                          int ret = 0;

               

                          Iterator it = items.iterator();

               

                          while (it.hasNext()) {

               

                              ChurchServiceData item = (ChurchServiceData) it.next();

               

                              String val = ""+item.getNewConverts();

               

                              if(val == null || val.trim().equals(""))  val = "0";

               

                              ret+=   Integer.parseInt(val);

               

                          }

               

                          return ret;

               

                      }

               

               

                      /*

                       *   getTotalChildren   returns total children

                       *

                       */

                      public int getTotalChildren() {

               

                          int ret = 0;

               

                          Iterator it = items.iterator();

               

                          while (it.hasNext()) {

               

                              ChurchServiceData item = (ChurchServiceData) it.next();

               

                              String val = ""+item.getChildren();

               

                              if(val == null || val.trim().equals(""))  val = "0";

               

                              ret+=   Integer.parseInt(val);

               

                          }

               

                          return ret;

               

                      }

               

                      /*

                       *   getTotalMales   returns total males

                       *

                       */

                      public int getTotalMales() {

               

                          int ret = 0;

               

                          Iterator it = items.iterator();

               

                          while (it.hasNext()) {

               

                              ChurchServiceData item = (ChurchServiceData) it.next();

               

                              String val = ""+item.getMale();

               

                              if(val == null || val.trim().equals(""))  val = "0";

               

                              ret+=   Integer.parseInt(val);

               

                          }

               

                          return ret;

               

                      }

               

                      /*

                       *   getTotalFemale   returns total female count

                       *

                       */

                      public int getTotalFemale() {

               

                          int ret = 0;

               

                          Iterator it = items.iterator();

               

                          while (it.hasNext()) {

               

                              ChurchServiceData item = (ChurchServiceData) it.next();

               

                              String val = ""+item.getFemale();

               

                              if(val == null || val.trim().equals(""))  val = "0.00";

               

                              ret+=   Integer.parseInt(val);

               

                          }

               

                          return ret;

               

                      }

               

                      /*

                       *   getTotalFirstTimers   returns total number of first timers

                       *

                       */

                      public int getTotalFirstTimers() {

               

                          int ret = 0;

               

                          Iterator it = items.iterator();

               

                          while (it.hasNext()) {

               

                              ChurchServiceData item = (ChurchServiceData) it.next();

               

                              String val = ""+item.getFirstTimers();

               

                              if(val == null || val.trim().equals(""))  val = "0.00";

               

                              ret+=   Integer.parseInt(val);

               

                          }

               

                          return ret;

               

                      }

               

                      /*

                       *   getTotalTestimonies   returns total testimonies

                       *

                       */

                      public int getTotalTestimonies() {

               

                          int ret = 0;

               

                          Iterator it = items.iterator();

               

                          while (it.hasNext()) {

               

                              ChurchServiceData item = (ChurchServiceData) it.next();

               

                              String val = ""+item.getTestimonies();

               

                              if(val == null || val.trim().equals(""))  val = "0";

               

                              ret+=   Integer.parseInt(val);

               

                          }

               

                          return ret;

               

                      }

               

               

               

                      public int getTotalPersons() {

               

                          return getTotalFirstTimers()+getTotalFemale()+getTotalChildren();

               

                      }

               

               

                      public double getTotalCollections()

                      {

                          return getTotalCashOffering()+getTotalOnlineOffering()+getTotalCashTithe()+getTotalShiloh()+getTotalOthers();

                      }

               

               

                      public int getItemsCount() {

               

                          return getItems().size();

               

                      }

               

               

              }

               

               

               

              import java.util.ArrayList;

              import java.util.Iterator;

              import java.util.List;

               

              import javax.persistence.EntityManager;

               

              import org.jboss.seam.ScopeType;

              import org.jboss.seam.annotations.In;

              import org.jboss.seam.annotations.Name;

              import org.jboss.seam.annotations.Scope;

               

              import com.etranzact.churchPortal.model.ChurchServiceData;

              import com.etranzact.churchPortal.model.UserInfo;

               

               

               

              @Name("reportHelper2")

              @Scope(ScopeType.CONVERSATION)

              public class CellReports {

               

               

               

                  @In(create=true)

                  EntityManager entityManager;

               

                  @In(required = true) 

                  UserInfo loggedInUser;

               

                  private List<ChurchServiceData>  records = new ArrayList<ChurchServiceData>();//null;

               

               

               

                  public List<ChurchServiceData> getRecords() {

               

                      System.out.println(": getRecords :"+records);

               

                      if (records==null) {

               

                          initRecords();

               

                      }

               

                      return records;

               

                  }

               

               

               

                  public void setRecords(List<ChurchServiceData> records) {

               

                      this.records = records;

               

                  }

               

               

               

                  public int getTotalFemales() {

               

                      int ret = 0;

               

                      Iterator it = getRecords().iterator();

               

               

                      while (it.hasNext()) {

               

               

                          CellReportRecord record = (CellReportRecord) it.next();

               

                          ret+=record.getTotalFemale();

               

                      }

               

                      return ret;

               

                  }

               

                  public int getTotalMales() {

               

                      int ret = 0;

               

                      Iterator it = getRecords().iterator();

               

                      while (it.hasNext()) {

               

                          CellReportRecord record = (CellReportRecord) it.next();

               

                          ret+=record.getTotalMales();

               

                      }

               

                      return ret;

               

                  }

               

                  public int getTotalFirstTimers() {

               

                      int ret = 0;

               

                      Iterator it = getRecords().iterator();

               

                      while (it.hasNext()) {

               

                          CellReportRecord record = (CellReportRecord) it.next();

               

                          ret+=record.getTotalFirstTimers();

               

                      }

               

                      return ret;

               

                  }

               

                  public int getTotalNewConverts() {

               

                      int ret = 0;

               

                      Iterator it = getRecords().iterator();

               

                      while (it.hasNext()) {

               

                          CellReportRecord record = (CellReportRecord) it.next();

               

                          ret+=record.getNewConverts();

               

                      }

               

                      return ret;

               

                  }

               

               

                  public int getTotalChildren() {

               

                      int ret = 0;

               

                      Iterator it = getRecords().iterator();

               

                      while (it.hasNext()) {

               

                          CellReportRecord record = (CellReportRecord) it.next();

               

                          ret+=record.getTotalChildren();

               

                      }

               

                      return ret;

               

                  }

               

                  public double getTotalShiloh() {

               

                      double ret = 0.0;

               

                      Iterator it = getRecords().iterator();

               

                      while (it.hasNext()) {

               

                          CellReportRecord record = (CellReportRecord) it.next();

               

                          ret+=record.getTotalShiloh();

               

                      }

               

                      return ret;

               

                  }

               

               

                  public double getTotalOnlineTithe() {

               

                      double ret = 0.0;

               

                      Iterator it = getRecords().iterator();

               

                      while (it.hasNext()) {

               

                          CellReportRecord record = (CellReportRecord) it.next();

               

                          ret+=record.getTotalOnlineTithe();

               

                      }

               

                      return ret;

               

                  }

               

                  public double getTotalOnlineOffering() {

               

                      double ret = 0.0;

               

                      Iterator it = getRecords().iterator();

               

                      while (it.hasNext()) {

               

                          CellReportRecord record = (CellReportRecord) it.next();

               

                          ret+=record.getTotalOnlineOffering();

               

                      }

               

                      return ret;

               

                  }

               

                  public double getTotalCashOffering() {

               

                      double ret = 0.0;

               

                      Iterator it = getRecords().iterator();

               

                      while (it.hasNext()) {

               

                          CellReportRecord record = (CellReportRecord) it.next();

               

                          ret+=record.getTotalCashOffering();

               

                      }

               

                      return ret;

               

                  }

               

                  public double getTotalCashTithe() {

               

                      double ret = 0.0;

               

                      Iterator it = getRecords().iterator();

               

                      while (it.hasNext()) {

               

                          CellReportRecord record = (CellReportRecord) it.next();

               

                          ret+=record.getTotalCashTithe();

               

                      }

               

                      return ret;

               

                  }

               

                  public double getTotalOthers() {

               

                      double ret = 0.0;

               

                      Iterator it = getRecords().iterator();

               

                      while (it.hasNext()) {

               

                          CellReportRecord record = (CellReportRecord) it.next();

               

                          ret+=record.getTotalOthers();

               

                      }

               

                      return ret;

               

                  }

               

                  public int getTotalTestimonies() {

               

                      int ret = 0;

               

                      Iterator it = getRecords().iterator();

               

                      while (it.hasNext()) {

               

                          CellReportRecord record = (CellReportRecord) it.next();

               

                          ret+=record.getTotalTestimonies();

               

                      }

               

                      return ret;

               

                  }

               

                  public double getGrandTotal() {

               

                      return getTotalOthers()+getTotalShiloh()+getTotalCashOffering()+getTotalOnlineOffering()+getTotalCashTithe()+getTotalOnlineTithe();

               

                  }

               

                  public int getRecordsCount() {

               

                      return getRecords().size();

               

                  }

               

               

               

                  private void initRecords() {

               

                      String sql = "";

               

                      //records = new ArrayList<ChurchServiceData>();

               

               

               

                       sql = " from ChurchServiceData  c  where   c.serviceCode = 'C'   group by c.provinceCode, c.fellowshipDate ";

                       // sql = "select c.provinceCode, sum(c.male), sum(c.female), sum(c.children), sum(c.newConverts), sum(c.firstTimers), sum(c.cashOffering),sum(c.onlineOffering),sum(c.cashTithe),sum(c.onlineTithe),sum(c.others),c.fellowshipDate,sum(c.shiloh),c.serviceCode,c.locationCode,c.provinceCode,c.districtCode,c.zoneCode,c.cellCode, sum(c.testimonies), c.mobileNo from ChurchServiceData  c  where   c.serviceCode = 'C'   group by c.provinceCode, c.fellowshipDate ";

                       //sql = "select c.provinceCode, sum(c.male), sum(c.female), sum(c.children), sum(c.newConverts), sum(c.firstTimers), sum(c.cashOffering),sum(c.onlineOffering),sum(c.cashTithe),sum(c.onlineTithe),sum(c.others),c.fellowshipDate,sum(c.shiloh),c.serviceCode,c.locationCode,c.provinceCode,c.districtCode,c.zoneCode,c.cellCode, sum(c.testimonies), c.mobileNo from ChurchServiceData  c  where  (c.fellowshipDate  BETWEEN '"+from+"'  and  '"+to+"')  and  c.serviceCode = 'Z'   group by c.provinceCode, c.fellowshipDate ";

               

                       records  = entityManager.createQuery(sql).getResultList();

               

                       System.out.println(": RECORDS SIZE :"+records.size());

                          //churchListbyZone  = (Object) entityManager.createQuery(sql).getResultList();

                      //records.add(rec);

               

                  }

               

              }

               

               

              // model

               

              package com.etranzact.churchPortal.model;

               

               

              // Generated Jan 26, 2011 6:39:07 AM by Hibernate Tools 3.2.4.GA

               

              import java.math.BigDecimal;

              import java.util.Date;

              import java.util.HashSet;

              import java.util.Set;

               

              import javax.persistence.Column;

              import javax.persistence.Entity;

              import javax.persistence.GeneratedValue;

              import static javax.persistence.GenerationType.IDENTITY;

               

              import javax.persistence.FetchType;

              import javax.persistence.Id;

              import javax.persistence.JoinColumn;

              import javax.persistence.ManyToOne;

              import javax.persistence.Table;

              import javax.persistence.Temporal;

              import javax.persistence.TemporalType;

              import javax.persistence.Transient;

               

              import org.hibernate.validator.Length;

              import org.hibernate.validator.NotNull;

               

              /**

              * ChurchServiceData generated by hbm2java

              */

              @Entity

              @Table(name = "church_service_data")

              public class ChurchServiceData implements java.io.Serializable {

               

                  private Long serviceId;

                  private String mobileNo;

                  private long male;

                  private long female;

                  private long children;

                  private long newConverts;

                  private long firstTimers;

                  private long testimonies;

                  private BigDecimal cashOffering;

                  private BigDecimal onlineOffering;

                  private BigDecimal cashTithe;

                  private BigDecimal onlineTithe;

                  private BigDecimal others;

                  private Date created;

                  private Date fellowshipDate;

                  private BigDecimal shiloh;

                  private String serviceCode;

                  private String locationCode;

                  private String provinceCode;

                  private String districtCode;

                  private String zoneCode;

                  private String cellCode;

               

                  private Date fromDate;

               

                  private Date toDate;

               

               

               

               

                  public ChurchServiceData() {

                  }

               

                  //String mobileNo,

                  public ChurchServiceData(String mobileNo,long male, long female,

                          long children, long newConverts, long firstTimers,

                          BigDecimal cashOffering, BigDecimal onlineOffering,

                          BigDecimal cashTithe, BigDecimal onlineTithe, BigDecimal others,

                          Date created,Date fellowshipDate, BigDecimal shiloh, String serviceCode, String  locationCode,

                          String provinceCode, String districtCode, String zoneCode, String cellCode, Long testimonies) {

                      this.mobileNo = mobileNo;

                      this.male = male;

                      this.female = female;

                      this.children = children;

                      this.newConverts = newConverts;

                      this.firstTimers = firstTimers;

                      this.cashOffering = cashOffering;

                      this.onlineOffering = onlineOffering;

                      this.cashTithe = cashTithe;

                      this.onlineTithe = onlineTithe;

                      this.others = others;

                      this.created = created;

                      this.fellowshipDate = fellowshipDate;

                      this.shiloh = shiloh;

                      this.serviceCode = serviceCode;

                      this.locationCode = locationCode;

                      this.provinceCode = provinceCode;

                      this.districtCode = districtCode;

                      this.zoneCode = zoneCode;

                      this.cellCode = cellCode;

                      this.testimonies = testimonies;

                      //this.reporterPhone = reporterPhone;

               

                  }

               

               

               

                  @Id

                  @GeneratedValue(strategy = IDENTITY)

                  @Column(name = "SERVICE_ID", unique = true, nullable = false)

                  public Long getServiceId() {

                      return this.serviceId;

                  }

               

                  public void setServiceId(Long serviceId) {

                      this.serviceId = serviceId;

                  }

               

                  @Column(name = "MOBILE_NO", nullable = false, length = 25)

                  @NotNull

                  @Length(max = 25)

                  public String getMobileNo() {

                      return this.mobileNo;

                  }

               

                  public void setMobileNo(String mobileNo) {

                      this.mobileNo = mobileNo;

                  }

                  /*

                  @ManyToOne(fetch = FetchType.LAZY)

                  @JoinColumn(name = "MOBILE_NO", nullable = false)

                  @NotNull

                  @Length(max = 25)

                  public UserInfo getReporterPhone() {

                      return reporterPhone;

                  }

               

                  public void setReporterPhone(UserInfo reporterPhone) {

                      this.reporterPhone = reporterPhone;

                  }

                  */

                  @Column(name = "MALE", nullable = false)

                  public long getMale() {

                      return this.male;

                  }

               

                  public void setMale(long male) {

                      this.male = male;

                  }

               

                  @Column(name = "FEMALE", nullable = false)

                  public long getFemale() {

                      return this.female;

                  }

               

                  public void setFemale(long female) {

                      this.female = female;

                  }

               

                  @Column(name = "CHILDREN", nullable = false)

                  public long getChildren() {

                      return this.children;

                  }

               

                  public void setChildren(long children) {

                      this.children = children;

                  }

               

                  @Column(name = "NEW_CONVERTS", nullable = false)

                  public long getNewConverts() {

                      return this.newConverts;

                  }

               

                  public void setNewConverts(long newConverts) {

                      this.newConverts = newConverts;

                  }

               

                  @Column(name = "FIRST_TIMERS", nullable = false)

                  public long getFirstTimers() {

                      return this.firstTimers;

                  }

               

                  public void setFirstTimers(long firstTimers) {

                      this.firstTimers = firstTimers;

                  }

               

                  @Column(name = "CASH_OFFERING", nullable = false, precision = 10)

                  @NotNull

                  public BigDecimal getCashOffering() {

                      return this.cashOffering;

                  }

               

                  public void setCashOffering(BigDecimal cashOffering) {

                      this.cashOffering = cashOffering;

                  }

               

                  @Column(name = "ONLINE_OFFERING", nullable = false, precision = 10)

                  @NotNull

                  public BigDecimal getOnlineOffering() {

                      return this.onlineOffering;

                  }

               

                  public void setOnlineOffering(BigDecimal onlineOffering) {

                      this.onlineOffering = onlineOffering;

                  }

               

                  @Column(name = "CASH_TITHE", nullable = false, precision = 10)

                  @NotNull

                  public BigDecimal getCashTithe() {

                      return this.cashTithe;

                  }

               

                  public void setCashTithe(BigDecimal cashTithe) {

                      this.cashTithe = cashTithe;

                  }

               

                  @Column(name = "ONLINE_TITHE", nullable = false, precision = 10)

                  @NotNull

                  public BigDecimal getOnlineTithe() {

                      return this.onlineTithe;

                  }

               

                  public void setOnlineTithe(BigDecimal onlineTithe) {

                      this.onlineTithe = onlineTithe;

                  }

               

                  @Column(name = "OTHERS", nullable = false, precision = 25, scale = 0)

                  @NotNull

                  public BigDecimal getOthers() {

                      return this.others;

                  }

               

                  public void setOthers(BigDecimal others) {

                      this.others = others;

                  }

                  @Column(name = "TESTIMONIES")

                  public long getTestimonies() {

                      return testimonies;

                  }

               

                  public void setTestimonies(long testimonies) {

                      this.testimonies = testimonies;

                  }

               

                  @Temporal(TemporalType.TIMESTAMP)

                  @Column(name = "CREATED", nullable = false, length = 19)

                  @NotNull

                  public Date getCreated() {

                      return this.created;

                  }

               

                  public void setCreated(Date created) {

                      this.created = created;

                  }

               

                  @Temporal(TemporalType.TIMESTAMP)

                  @Column(name = "FELLOWSHIP_DATE", nullable = false, length = 19)

                  @NotNull

                  public Date getFellowshipDate() {

                      return this.fellowshipDate;

                  }

               

                  public void setFellowshipDate(Date fellowshipDate) {

                      this.fellowshipDate = fellowshipDate;

                  }

               

               

               

                  @Column(name = "SHILOH", nullable = false, precision = 10)

                  @NotNull

                  public BigDecimal getShiloh() {

                      return this.shiloh;

                  }

               

                  public void setShiloh(BigDecimal shiloh) {

                      this.shiloh = shiloh;

                  }

               

                  @Column(name = "SERVICE_CODE", nullable = false, length = 1)

                  @NotNull

                  @Length(max = 1)

                  public String getServiceCode() {

                      return this.serviceCode;

                  }

               

                  public void setServiceCode(String serviceCode) {

                      this.serviceCode = serviceCode;

                  }

                  @Column(name = "LOCATION_CODE", nullable = false, length = 12)

                  @NotNull

                  @Length(max = 12)

                  public String getLocationCode() {

                      return locationCode;

                  }

                  public void setLocationCode(String locationCode) {

                      this.locationCode = locationCode;

                  }

               

                  @Column(name = "PROVINCE_CODE", nullable = false, length = 12)

                  @NotNull

                  @Length(max = 12)

                  public String getProvinceCode() {

                      return provinceCode;

                  }

                  public void setProvinceCode(String provinceCode) {

                      this.provinceCode = provinceCode;

                  }

               

                  @Column(name = "DISTRICT_CODE", nullable = false, length = 12)

                  @NotNull

                  @Length(max = 12)

                  public String getDistrictCode() {

                      return districtCode;

                  }

                  public void setDistrictCode(String districtCode) {

                      this.districtCode = districtCode;

                  }

               

                  @Column(name = "ZONE_CODE", nullable = false, length = 12)

                  @NotNull

                  @Length(max = 12)

                  public String getZoneCode() {

                      return zoneCode;

                  }

                  public void setZoneCode(String zoneCode) {

                      this.zoneCode = zoneCode;

                  }

               

               

                  @Column(name = "CELL_CODE", nullable = false, length = 12)

                  @NotNull

                  @Length(max = 12)

                  public String getCellCode() {

                      return cellCode;

                  }

                  public void setCellCode(String cellCode) {

                      this.cellCode = cellCode;

                  }

               

                     @Transient

                     @Temporal(TemporalType.DATE)

                     public Date getFromDate()

               

                     {

               

                        return fromDate;

               

                     }

               

                     public void setFromDate(Date datetime)

               

                     {

               

                        this.fromDate = datetime;

               

                     }

               

                     @Transient

                     @Temporal(TemporalType.DATE)

                     public Date getToDate()

               

                     {

               

                        return toDate;

               

                     }

               

                     public void setToDate(Date checkoutDate)

               

                     {

               

                        this.toDate = checkoutDate;

               

                     }

               

              }

              • 5. Re: How to use rich: dataTable, rich: subTable, subTable contractions started.
                ilya_shaikovsky

                please do not duplicate the questions in numersus threads.. in that cases we not sure where to answer and it will be hard for you to find the answer if any posted somewhere. Just create/comment single topic and we really will see your request in email notifications. Please ne patient I will review that thread today.

                • 6. Re: How to use rich: dataTable, rich: subTable, subTable contractions started.
                  taysay

                  Hi Ilya,

                   

                  Sorry about that, I was just kind of holed up. But thank God I will be hearing from you soon. Have a wonderful day till I hear from you, Quick one frpom my understanding of using subtables .

                   

                  width="700" border="0" var="record" value="#{reportsActionBean.churchRecords}">

                   

                  and

                   

                  var="expense" value="#{record.items}">

                   

                   

                     <rich:subTable   .....

                   

                  i believe  reportsActionBean.churchRecords containes a list of say churchRecords  and record on the subtable node is an instance of the list of churchRecords  which could range from 0  to n instances, if any as added or derived from reportsActionBean.churchRecords ? Please am I right ? if so then what is the relationship between the "record" and the record.items on the management bean side.?

                   

                  Thank you have a wonderful day

                  • 7. Re: How to use rich: dataTable, rich: subTable, subTable contractions started.
                    ilya_shaikovsky

                    reportsActionBean should has something like:

                     

                    public class ReportsActionBean{

                         ...

                         private List<ChurchRecord> churchRecords;

                         ...

                    }

                     

                    and ChurchRecord should has the next list:

                    public class ChurchRecord{

                         ...

                         private List<SomeItem> items;

                         ...

                    }

                     

                    then the table iterates the churchRecords and subtable iterated items for every row from churchRecords.

                    • 8. Re: How to use rich: dataTable, rich: subTable, subTable contractions started.
                      taysay

                      Hi Ilya ,

                      Thank you very much for you help, though I was able to fiqure it out prior to this moment what got me real confused was .

                       

                      1.   report.expReport.records   no the rich:datatable example

                      2. records.items on the rich:subtable 

                       

                      from you examples rich datatable  on the class files people following the exaple may get confused  particularly when the records.items is called on the sub table. but it is all good . So what I did was assume I have 2 classes at this point report.expReport.records then go to report and look out for expReport and then report.expReport.records  to look out for records and all that but i had to neglect the report bit and use   expReport.records and in a short while I was good to go .

                       

                      thanx for your time , I had wanted to do a post earlier to let you know I am good to go but my internet was down. tanx have a good one wishing you well in all your endeavoz.