/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.csgi.async; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import org.icefaces.application.PortableRenderer; import org.icefaces.application.PushRenderer; import org.icefaces.util.JavaScriptRunner; /** * Backing bean for our page. * @author leon */ @ManagedBean @ViewScoped public class PageBean { private PortableRenderer renderer; private String displayValue = "Please wait..."; public void unblock(ActionEvent event) { displayValue = displayValue + " success!"; renderer.render("renderGroup"); } @PostConstruct public void initBean() { PushRenderer.addCurrentView("renderGroup"); renderer = PushRenderer.getPortableRenderer(); JavaScriptRunner.runScript(FacesContext.getCurrentInstance(), "document.getElementById('iceForm:unblock').click();"); } public String getDisplayValue() { return displayValue; } }