Page 1 of 1

How can I show a progressbar from 1..100%

PostPosted: 06 Jun 2017 13:03
by jorgo
Hi,
I want to implement a progressbar.
I tested following:

************************
Comonents on Form:
- IWCGJQButton1: TIWCGJQButton;
- CGJQContainer: TIWCGJQRegion;

Progressbar on CGJQContainer:
IWCGJQProgressBar: TIWCGJQProgressBar;

************************
procedure TFORM_Login.IWCGJQButton1JQButtonOptionsClick(Sender: TObject; AParams: TStringList);
var
i : integer;

begin
for i := 1 to 100 do
begin
CGCallBackDisableAjaxResponse;
IWCGJQProgressBar.ResetJSonProps;
IWCGJQProgressBar.JQProgressBarOptions.Value:= i;
IWCGJQProgressBar.JQProgressBarOptions.CaptionType:= pbctPercentage;
IWCGJQProgressBar.JQProgressBarOptions.Animation.Enable:= False;
CGCallBackEnableAjaxResponse;
RenderRegionAsync(CGJQContainer, rramLazyLoadMethod, True);

Sleep(50);
end;
end;
************************
After 5 seconds the progressbar shows only the last value (100%).
How can I show all values from 1% to 100% ?

Kind regards

Re: How can I show a progressbar from 1..100%

PostPosted: 06 Jun 2017 17:05
by Alexander Bulei

Re: How can I show a progressbar from 1..100%

PostPosted: 07 Jun 2017 14:55
by jorgo
Hi,

as alternative we found https://forums.embarcadero.com/thread.jspa?messageID=847524

But handling a separate thread is an extra effort.

Kind regards

Re: How can I show a progressbar from 1..100%

PostPosted: 09 Jun 2017 07:14
by assapan
With Delphi XE ( i don't remember from which version it starts) there is a much more easy way of handling temporary threads like
TTask.Run(
procedure
begin
// do what you have to do
end);

Re: How can I show a progressbar from 1..100%

PostPosted: 09 Jun 2017 07:35
by assapan
See an example of how to use it