4 Replies Latest reply on Jun 5, 2007 7:29 AM by Christian Bauer

    Polling a progress monitor

    Christian Bauer Master

      I'm trying to implement the following functionality:

      A bean in some scope has a percentage progress, say #{progressMonitor.percentComplete} and a status string, say #{progressMonitor.status}.

      This bean instance is asynchronously updated after a particular a:commandButton is clicked, the bound action starts a background process.


      A. If the button is clicked, poll the backing bean every second and show the percentComplete value (e.g. as a progress bar). Also show the status string.

      B. If the status string is "Complete" (or some other condition is met), stop polling.

      C. After "Complete" and polling stopped, reRender another area (e.g. a datatable).

      I tried implementing this first with a mix of jQuery, Seam Remoting, and JSF/A4JSF but couldn't get C. done, there is no obvious way how you can trigger a reRender from jQuery Javascript.

      My next attempt with a:poll wasn't very successful either, it stops polling even though the enabled="condition" is still true.

      It seems like I have to live without feature C. How can I at least offer the user a button he can click, to reRender a region?