/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.csgi.async; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId; import org.icefaces.application.PortableRenderer; import org.icefaces.application.PushRenderer; /** * Backing bean for our page. * @author leon */ @ManagedBean @ViewScoped public class PageBean { private PortableRenderer renderer; private String displayValue = "Please wait..."; private boolean pushComplete = false; @PostConstruct public void initBean() { PushRenderer.addCurrentView("renderGroup"); renderer = PushRenderer.getPortableRenderer(); } public void afterPhase(PhaseEvent event) { if (PhaseId.RENDER_RESPONSE == event.getPhaseId()) { if (pushComplete) { return; } pushComplete = true; displayValue = displayValue + " success!"; renderer.render("renderGroup"); } } public String getDisplayValue() { return displayValue; } }