TIWCGJQLockIndicator

Posted:
20 Jun 2013 15:00
by Futura
Hi
I'm using TIWCGJQLockIndicator, but I can't create it in RunTime.
I'm trying to use only one for the entire system, so if i change the loading GIF, I don't have to change in all screens.
also, can I link it to any form property?
Att. Futura.
Re: TIWCGJQLockIndicator

Posted:
20 Jun 2013 17:58
by Jorge Sousa
Hi Futura:
If in RunTime, you also mean in an ajax/async event, you cannot do it, only in full submit events (ajax = false) or OnCreate / OnRender.
You can use only one for entire system in the servercontroller, but since servercontroller isn't thread save, you can't modify it after the app started, because each event is a new thread, and the events can occurr at the same time for different sessions, you must not change ServerController.IWCGLockIndicator1 unless you use Critical Sections.
Because of performance, The name if the Indicator has to be IWCGJQLockIndicator1, to be quickly found.
Best Regards
cgdevtools
Re: TIWCGJQLockIndicator

Posted:
20 Jun 2013 19:55
by Futura
I Mean create the component at codelines, instead of placing it on the Form.
i used it on Form OnCreate but doesn't work:
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
With TIWCGJQLockIndicator.Create(Self) do
begin
Indicators.Add;
AsyncIndicatorIndex := 0;
SubmitIndicatorIndex := 0;
end;
end;
Re: TIWCGJQLockIndicator

Posted:
21 Jun 2013 10:11
by Alexander Bulei
Hi Futura,
You forgot to specify the component name.
- Code: Select all
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
With TIWCGJQLockIndicator.Create(Self) do
begin
Name:= 'IWCGJQLockIndicator1'; // <- add this line
Indicators.Add;
AsyncIndicatorIndex := 0;
SubmitIndicatorIndex := 0;
end;
end;
This code
- Code: Select all
IWCGJQLockIndicator.Indicators.Add
return you TIWCGJQLockIndicatorItem, so you can edit some properties.
Example:
- Code: Select all
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
var
LItem: TIWCGJQLockIndicatorItem;
begin
With TIWCGJQLockIndicator.Create(Self) do
begin
Name:= 'IWCGJQLockIndicator1';
LItem:= Indicators.Add;
LItem.ImageSetting.Image:= jqlidiLoading17;
LItem.ImageSetting.Alignment:= jqliiaTop;
AsyncIndicatorIndex := 0;
SubmitIndicatorIndex := 0;
end;
end;
Best Regards.