CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

OnClick Button -> Disable Button -> show wait animation

by jorgo » 18 Aug 2016 11:43

Hi,

I want the basic functionallity of a button:
- Click on button
- disable button (prevent more clicks)
- show a wait animation (e.g. your bubbles in a circle)

My steps:

1.) Place "IWCGJQLockIndicator1" on ServerController
- Add a new item to property Indicators

2.) Add a OnClick event for JQButtonOptions
- Select prop. Indicator as IWServerController.IWCGJQLockIndicator1
- Select prop. IndicatorIndex = 0

3.) JQButtonOptions OnClick event handler

Code: Select all
procedure TIWForm1.IWCGJQButton1JQButtonOptionsClick(Sender: TObject; AParams: TStringList);
begin
    IWCGJQButton1.JQButtonOptions.Disabled := true;
    IWCGJQButton1.AjaxReRender(False, True);

    Sleep(3000);
end;


I expected following sequence:
- button disabled
- wait animation for 3 seconds

What must I change to get it runing?

Kind regards
jorgo
 
Posts: 108
Joined: 13 Jul 2016 15:57

by Alexander Bulei » 18 Aug 2016 11:50

Hello,

You don't need use the disabled property, since the lock indicator will lock whole page.

You don't see the lock animation?

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

by jorgo » 18 Aug 2016 15:40

Hi,

if I set it in object inspector I see nothing.
If I set it during runtime it's working:

Code: Select all
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
   IWCGJQButton1.JQButtonOptions.OnClick.Indicator:= IWServerController.IWCGJQLockIndicator1;
   IWCGJQButton1.JQButtonOptions.OnClick.IndicatorIndex:= 0;
end;


1.) Question: Is it possible to get an "Overlay screen" + "image" without that bordered-region around the image?
2.) Question: Is it possible to change the backcolor of the "Overlay screen"? (A soft blue or green would be my wish)

Kind regards
jorgo
 
Posts: 108
Joined: 13 Jul 2016 15:57

by Alexander Bulei » 18 Aug 2016 16:31

Hi,

IWServerController.IWCGJQLockIndicator1


Since you have it on IWServerController, you need always set in run-time.

1.) Question: Is it possible to get an "Overlay screen" + "image" without that bordered-region around the image?


What are you talking about?

2.) Question: Is it possible to change the backcolor of the "Overlay screen"? (A soft blue or green would be my wish)


Yes, check the OverlayCss property of Item, and add the background color.

E.g:

Code: Select all
"background":"#000000"


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 JQButton & JQButtonSet

Who is online

Users browsing this forum: No registered users and 3 guests

Contact Us.