im using primefaces datatable to display my data here is my code:
<p:dataTable id="tab6" var="comp" value="#{excelReport.report6}" rendered="#{excelReport.date != null}">
<f:facet name="header">
<h:outputText value="heading text"/>
</f:facet>
<p:columnGroup type="header">
<p:row>
<p:column headerText="Sr No" />
<p:column headerText="Years" />
<p:column headerText="Quarter no." />
<p:column headerText="POL" />
<p:column headerText="LPG" />
<p:column headerText="AVIATION" />
<p:column headerText="LUBES" />
<p:column headerText="OTHERS" />
</p:row>
</p:columnGroup>
<p:column><h:outputText value="#{comp.serialNo}" /> </p:column>
<p:column><h:outputText value="#{comp.quarterRange}" /></p:column>
<p:column><h:outputText value="#{comp.quarterNumber}" /></p:column>
<p:column><h:outputText value="#{comp.pol}" /></p:column>
<p:column><h:outputText value="#{comp.lpg}" /></p:column>
<p:column><h:outputText value="#{comp.aviation}" /></p:column>
<p:column><h:outputText value="#{comp.lubes}" /></p:column>
<p:column><h:outputText value="#{comp.others}" /></p:column>
<p:columnGroup type="footer">
<p:row>
<p:column footerText="Total" colspan="3"/>
<p:column footerText="#{comp.polTotal}"/>
<p:column footerText="#{comp.lpgTotal}"/>
<p:column footerText="#{comp.aviationTotal}"/>
<p:column footerText="#{comp.lubesTotal}"/>
<p:column footerText="#{comp.othersTotal}"/>
</p:row>
</p:columnGroup>
</p:dataTable>
Every thing is working fine except i'm not getting any data in my footer row. i'm trying to display the static variable of int type in my footerText.
here is by bean :
package dao;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
@ManagedBean
@ViewScoped
public class Excel_Target_Compliance implements Serializable {
public Excel_Target_Compliance() {
}
private String quarterRange;
private String quarterNumber;
private int pol;
private int lpg;
private int aviation;
private int lubes;
private int others;
private int serialNo;
static int polTotal;
static int lpgTotal;
static int aviationTotal;
static int lubesTotal;
static int othersTotal;
public static int getPolTotal() {
return polTotal;
}
public static int getLpgTotal() {
return lpgTotal;
}
public static int getAviationTotal() {
return aviationTotal;
}
public static int getLubesTotal() {
return lubesTotal;
}
public static int getOthersTotal() {
return othersTotal;
}
public int getSerialNo() {
return serialNo;
}
public void setSerialNo(int serialNo) {
this.serialNo = serialNo;
}
public String getQuarterRange() {
return quarterRange;
}
public void setQuarterRange(String quarterRange) {
this.quarterRange = quarterRange;
}
public String getQuarterNumber() {
return quarterNumber;
}
public void setQuarterNumber(String quarterNumber) {
this.quarterNumber = quarterNumber;
}
public int getPol() {
return pol;
}
public void setPol(int pol) {
polTotal = polTotal + pol;
this.pol = pol;
}
public int getLpg() {
return lpg;
}
public void setLpg(int lpg) {
lpgTotal = lpgTotal + lpg;
this.lpg = lpg;
}
public int getAviation() {
return aviation;
}
public void setAviation(int aviation) {
aviationTotal = aviationTotal + aviation;
this.aviation = aviation;
}
public int getLubes() {
return lubes;
}
public void setLubes(int lubes) {
lubesTotal = lubesTotal + lubes;
this.lubes = lubes;
}
public int getOthers() {
return others;
}
public void setOthers(int others) {
othersTotal = othersTotal + others;
this.others = others;
}
}