Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 2.0-Beta2
-
Fix Version/s: 2.0.0
-
Component/s: ICE-Components
-
Labels:None
-
Environment:-
-
ICEsoft Forum Reference:
Description
The ice:outputProgress bar is not being updated when used with the PushRenderer in JSF 2.0 trunk (as of Nov 13). 2.0 trunk is being used to overcome the regression mentioned in http://www.icefaces.org/JForum/posts/list/17898.page. As the forum post mentions, this could be the result of an incorrect implementation but it appears as though it should work.
<ice:outputProgress value="#{progressBean.progress}" />
<ice:commandButton value="start" action="#{progressBean.go}" />
public void go() throws InterruptedException {
PushRenderer.addCurrentSession("x");
progress = 1;
PushRenderer.render("x");
System.out.println("started");
Thread.sleep(5000);
System.out.println("done");
progress = 0;
}
Test case intended for deployment on Tomcat6 attached.
<ice:outputProgress value="#{progressBean.progress}" />
<ice:commandButton value="start" action="#{progressBean.go}" />
public void go() throws InterruptedException {
PushRenderer.addCurrentSession("x");
progress = 1;
PushRenderer.render("x");
System.out.println("started");
Thread.sleep(5000);
System.out.println("done");
progress = 0;
}
Test case intended for deployment on Tomcat6 attached.
I think this might be more of a usage issue. I recommend taking a look at the following class in the Component Showcase demo:
org.icefaces.application.showcase.view.bean.examples.component.progressBar.OutputProgressController
To simulate a long-runnning process and modify the status of the progress bar, there is a TimerTask created in the startLongProcress() [sic] method:
public void startLongProcress(ActionEvent event)
{ Timer timer = new Timer(true); timer.scheduleAtFixedRate( new LongOperationRunner(timer, outputProgressModel), 0, PROCCESS_SLEEP_LENGTH ); }The LongOperationRunner is an inner class that handles updating the progress bar status values and calling the render request:
public void run() {
{ ouputProgressModel.setPogressStarted(true); }if (0 == percentComplete)
ouputProgressModel.setPercentComplete(percentComplete);
{ ouputProgressModel.setPogressStarted(false); timer.cancel(); }SessionRenderer.render("progressExample");
if (percentComplete >= 100)
percentComplete += 10;
}
The way the attached test case runs, it only runs once, stopping the actual request thread for 5 seconds (to simulate some work being done during the request). You'll need to offload the progress updating and pushing as outlined in the Component Showcase example.