hi all
i have two problems with primefaces tag this is my backbean Code:
public class LiveChartBean {
private Integer primaryKey;
public Integer getPrimaryKey() {
return primaryKey;
}
public void setPrimaryKey(Integer primaryKey) {
this.primaryKey = primaryKey;
}
public List<ChartData> getChartData() {
return MonitoringManager.getChartData(3);
}
}
and this my jsf page code:
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@taglib uri="http://primefaces.prime.com.tr/ui" prefix="p"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSF 'LiveChart.jsp' starting page</title>
</head>
<body>
<f:view>
<p:resources/>
<h:form>
<t:inputHidden id="primaryKey" value="#{ChartBean.primaryKey}" forceId="true" />
<p:lineChart live="true" value="#{ChartBean.chartData}" var="data"
xfield="#{data.index}">
<p:chartSeries label="ResponseTime" value="#{data.data}" />
</p:lineChart>
</h:form>
</f:view>
</body>
</html>
this is my faces-config entry:
<managed-bean>
<managed-bean-name>ChartBean</managed-bean-name>
<managed-bean-class>com.pardis.healthMonitor.LiveChartBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>primaryKey</property-name>
<property-class>java.lang.Integer</property-class>
<value>#{param.primaryKey}</value>
</managed-property>
</managed-bean>
i have passed primaryKey by url to jsf page it works fine and the setPrimaryKey method
called for the first time but after that
i have two problems:
1- it throws javax.el.ELException: Can't set property 'primaryKey' on class 'com.pardis.healthMonitor.LiveChartBean' to value 'null'.
and
- getChartData() method only called seven times!!!!