You need to sign in to do that
Don't have an account?
asadim
Progress bar?
Hi,
Does anybody know how to display a progress bar in VF? The counter would be provided by the controller. actionPoller is very slow (cannot be faster than every 5 sec) so I'm looking for another method. I'm sure something must be possible using actionSupport or actionFunction but I'm not sure how to go about it.
Thanks.
I don't know your situation which you want to apply a progress bar for, but I can't come up with any situation which you can apply it. The key word is "View State". Even though we can make asynchronous calls, it doesn't mean it is working on "A" server and we can access to it from other thread.
There might be a situation with Batch Apex. I don't think the ApexJob record can have custom parameter field, but if your batch keep updating certain record and your controller looks at the record, it's possible. But in that case, 5 second interval is pretty much reasonable. I don't think it's a very good idea to query every 0.1 second...
If you are really crazy about the interval, define actionFunction and define onComplete to call the same function, so it will loop. Don't forget the exit condition. Before you call the same function, check an flag retruned from the controller, then you can stop the loop. It doesn't gurantee that it's faster than 5 seconds, though.
ThomasTT
All Answers
I don't know your situation which you want to apply a progress bar for, but I can't come up with any situation which you can apply it. The key word is "View State". Even though we can make asynchronous calls, it doesn't mean it is working on "A" server and we can access to it from other thread.
There might be a situation with Batch Apex. I don't think the ApexJob record can have custom parameter field, but if your batch keep updating certain record and your controller looks at the record, it's possible. But in that case, 5 second interval is pretty much reasonable. I don't think it's a very good idea to query every 0.1 second...
If you are really crazy about the interval, define actionFunction and define onComplete to call the same function, so it will loop. Don't forget the exit condition. Before you call the same function, check an flag retruned from the controller, then you can stop the loop. It doesn't gurantee that it's faster than 5 seconds, though.
ThomasTT