ICEfaces
  1. ICEfaces
  2. ICE-6281

ice:outputProgress not updating when used with PushRenderer

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0-Beta2
    • Fix Version/s: 2.0.0
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      -

      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.

        Activity

        Tyler Johnson created issue -
        Tyler Johnson made changes -
        Field Original Value New Value
        Salesforce Case [5007000000ESh7I]
        Tyler Johnson made changes -
        Attachment outputProgress.war [ 12689 ]
        Ken Fyten made changes -
        Fix Version/s 2.0.0 [ 10230 ]
        Assignee Priority P2
        Assignee Deryk Sinotte [ deryk.sinotte ]
        Hide
        Nicklas Karlsson added a comment -

        This might be a general push-in-single-method problem since I can reproduce it with a outputText in the same manner.

        Show
        Nicklas Karlsson added a comment - This might be a general push-in-single-method problem since I can reproduce it with a outputText in the same manner.
        Ken Fyten made changes -
        Assignee Priority P2 P1
        Hide
        Deryk Sinotte added a comment -

        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() {
        if (0 == percentComplete)

        { ouputProgressModel.setPogressStarted(true); }

        ouputProgressModel.setPercentComplete(percentComplete);
        SessionRenderer.render("progressExample");
        if (percentComplete >= 100)

        { ouputProgressModel.setPogressStarted(false); timer.cancel(); }

        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.

        Show
        Deryk Sinotte added a comment - 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() { if (0 == percentComplete) { ouputProgressModel.setPogressStarted(true); } ouputProgressModel.setPercentComplete(percentComplete); SessionRenderer.render("progressExample"); if (percentComplete >= 100) { ouputProgressModel.setPogressStarted(false); timer.cancel(); } 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.
        Deryk Sinotte made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Won't Fix [ 2 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P1

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: