CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

TIWCGJQLockIndicator

by Futura » 20 Jun 2013 15:00

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.
Futura
 
Posts: 42
Joined: 10 Jun 2013 18:37

by Jorge Sousa » 20 Jun 2013 17:58

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
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Futura » 20 Jun 2013 19:55

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;
Futura
 
Posts: 42
Joined: 10 Jun 2013 18:37

by Alexander Bulei » 21 Jun 2013 10:11

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.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQLockIndicator

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.