package com.icefaces.support.example; import com.icesoft.faces.component.inputfile.InputFile; import com.icesoft.faces.component.inputfile.InputFileProgressEvent; import com.icesoft.faces.webapp.xmlhttp.PersistentFacesState; import com.icesoft.faces.webapp.xmlhttp.RenderingException; import java.io.File; import java.util.EventObject; public class TestBean { private File file; private String fileLocation; private int percent; private PersistentFacesState state; public TestBean() { state = PersistentFacesState.getInstance(); } public File getFile() { return file; } public String getFileLocation() { return fileLocation; } public int getPercent() { return percent; } public void setFile(File file) { this.file = file; fileLocation = file.getPath(); } public void setPercent(int percent) { this.percent = percent; } // Required to bind the InputFile component to its OutputProgress component. public void progress(EventObject event) throws RenderingException { InputFile inputFileComponent = (InputFile) event.getSource(); percent = inputFileComponent.getFileInfo().getPercent(); // try { // if (state != null) { // state.render(); // } // } catch (RenderingException ee) { // System.out.println(ee.getMessage()); // } } }