Skip to content
Snippets Groups Projects
Commit 3e97e180 authored by Bjoern Weissenfels's avatar Bjoern Weissenfels
Browse files

change scope from session to view

parent a51c4946
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;
import javax.faces.event.AjaxBehaviorEvent;
import livedemo.entities.DataEntry;
......@@ -26,7 +26,7 @@ import org.primefaces.model.chart.ChartSeries;
* @author Bjoern Weissenfels
*/
@ManagedBean(name="chartBean", eager=true)
@SessionScoped
@ViewScoped
public class ChartBean implements Observer{
int numberOfDisplayedEntries = 12;
......@@ -67,6 +67,7 @@ public class ChartBean implements Observer{
@PostConstruct
public void init(){
this.dataBean.addObserver(this);
System.out.println("View gestartet");
for(int i=10; i<=this.maxNumberOfDisplayedEntries;i++){
this.possibleNumberOfDisplayedEntries.add(i);
}
......
......@@ -15,7 +15,7 @@ import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;
import javax.faces.event.AjaxBehaviorEvent;
import org.primefaces.model.chart.CartesianChartModel;
import org.primefaces.model.chart.ChartSeries;
......@@ -29,7 +29,7 @@ import livedemo.entities.Model;
* @author Bjoern Weissenfels
*/
@ManagedBean(name="cpuBean", eager=true)
@SessionScoped
@ViewScoped
public class CpuBean implements Observer{
@ManagedProperty(value = "#{dataBean}")
......
......@@ -3,7 +3,7 @@ package livedemo.managedbeans;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;
import livedemo.entities.Record;
......@@ -11,7 +11,7 @@ import livedemo.entities.Record;
* @author Bjoern Weissenfels
*/
@ManagedBean(name="recordBean", eager=true)
@SessionScoped
@ViewScoped
public class RecordListBean{
boolean firstCall;
......
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment