On 8/23/07, Brett M. Bergquist <bbergquist_at_canoga.com> wrote:
>
> I'm currently using the Ajax Blueprints 0.1.1 ProgressBar component.
> This is the only component of this component library that I am using and
> would like to move over to the new ProgressBar component and eliminate
> this library.
>
> Basically what I am doing with this component is that I have web pages
> that have long running processing when submitted. These are actually
> talking to network equipment via the SNMP protocol and this may take a
> while to process. So instead of having the user sit and look at a
> screen that looks like it is stuck, I submit the work for asynchronous
> processing and return the page response. In the page response, I render
> a ProgressBar to monitor the progress of the work. Basically this uses
> Ajax to talk to the server to see if the work is done, and if so, the
> ProgressBar component then refreshes the page, were the results of the
> work are picked up and displayed. I'm not going whole hog wild right
> now with Ajax to limit my problems so for now, I just need to refresh
> the page when the ProgressBar is informed that it is complete.
>
> Looking over the new ProgressBar, I'm having some trouble figuring out
> how to do the same thing.
>
> * With the old, I had to set the "auto-start" property on the
> ProgressBar so that it would start polling for percentage complete
> when it was rendered. How is this done with the new ProgressBar
> or is it "auto-start" by default?
Component supports taskState attribute for which valid values are:
not_started, running, paused, resumed, canceled, failed, completed and
stopped.
By default the task state for progressbar component is "TASK_NOT_STARTED",
component changes the "TASK_NOT_STARTED" to "RUNNING" if progress > 0. You
can also set the taskState to "running" in your backing bean.
You may want to look into example app for progressbar component
http://webdev2.sun.com/example/faces/index.jsp
* With the old, I was able to invoke a javascript function on
> completion. I don't see the same tag now. Basically I need to
> refresh the page when the percentage complete becomes 100. With
> the old, my javascript submitted the page by performing a "click"
> on a Refresh button on the page. How do I accomplish the same
> thing now?
Component exposes a javascript function "setOnComplete(function name)" which
gets invoked on completion of task.
This is how you need to call this function:
document.getElementById(progressbar component id).setOnComplete(complete);
function complete() {
//add the script code to refresh the page.
}
Thanks!
Animesh
Any help will be greatly appreciated.
>
> Brett
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net
> For additional commands, e-mail: users-help_at_woodstock.dev.java.net
>
>