CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Is there an alternative way to JQLockIndicator ...

by jorgo » 27 Oct 2016 09:45

Hi,

we have an existing, big project with IW and TMS components.
Now we use cgdev components for new pages.
We had constant errors with JQLockIndicator.
After changing between pages we often got "Session invalid".
After deleting JQLockIndicator the project is working correct again.
So we need a way to use the standard IWLocker of Intraweb on cgdev pages.

Following way works only with Intraweb components:
(It works not with Asynch OnClick event)

Code: Select all
procedure TIWForm2.IWButton2Click(Sender: TObject);
begin
  WebApplication.CallBackResponse.AddJavaScriptToExecute( 'ActiveLock();' );

  Sleep(5000);

  WebApplication.CallBackResponse.AddJavaScriptToExecute( 'ReleaseLock();' );
  WebApplication.ShowNotification( 'waiting for 5 seconds' );
end;


Is there a way to use the normal locker?

Kind regards
Last edited by jorgo on 27 Oct 2016 11:21, edited 1 time in total.
jorgo
 
Posts: 108
Joined: 13 Jul 2016 15:57

by Alexander Bulei » 27 Oct 2016 09:48

Hi jorgo,

We had constant errors with JQLockIndicator.
After changing between pages we often got "Session invalid".


As you can check our demo, the component works as expected.

procedure TIWForm2.IWButton2Click(Sender: TObject);
begin
WebApplication.CallBackResponse.AddJavaScriptToExecute( 'ActiveLock();' );

Sleep(5000);

WebApplication.CallBackResponse.AddJavaScriptToExecute( 'ReleaseLock();' );
WebApplication.ShowNotification( 'waiting for 5 seconds' );
end;


It doesn't work in this way.

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 » 27 Oct 2016 10:36

Hi Alexander,

no question, JQLockIndicator is working in projects using only cgdev components.
The mixing maybe makes sometimes problems.

Is there a way to use "ActiveLock();"
There was something with

WebApplication.CallbackResponse.AddJavaScriptToExecuteAsCDATA(js);


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

by Alexander Bulei » 27 Oct 2016 12:01

Hi jorgo,

Only one way...by using iwtimer...

WebApplication.CallBackResponse.AddJavaScriptToExecute( 'ActiveLock();' );

Sleep(5000);

WebApplication.CallBackResponse.AddJavaScriptToExecute( 'ReleaseLock();' );


The server will generate the js code, only after executing the procedure/function...in this case, it will execute 'ActiveLock' and 'ReleaseLock' at same time...so you will not see the results (lock)..

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 » 31 Oct 2016 14:11

Hi Alexander,

IWTimer trick is working.

Ugly sideeffect is, that the form is reloaded after "ReleaseLock".
Is there a fade-in effect for the form?
So it locks like falling into the house with the door (form).

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

by Alexander Bulei » 31 Oct 2016 15:30

Hi jorgo,

Ugly sideeffect is, that the form is reloaded after "ReleaseLock".


What do you mean with reloaded?

I hope you are using IWTimer.OnAsyncTimer event, right?

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 » 03 Nov 2016 12:00

Hi Alexander,

no I don't use the Async Event. If I use it the IWLocker is not shown, and the trick wouldn't work.
I use the synchron IWTimer.OnTimer event.

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

by jorgo » 03 Nov 2016 16:06

Hi,
I have an alternative way to use IWLocker from Intraweb with a cgDevTools button:

Code: Select all
1.) Standard Intraweb button

IWButton1.LockOnAsynchEvent := [aeClick];
Visible := False;

procedure TIWForm1.IWButton1AsyncClick(Sender: TObject; EventParams: TStringList);
begin
   Sleep(5000);
end;


Code: Select all
2.) cgDevTools button

procedure TIWForm1.IWCGJQButton1JQButtonOptionsClick(Sender: TObject; AParams: TStringList);
var
   jsCode : string;

begin
   jsCode := 'document.getElementById(''IWBUTTON1'').click();';
   WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA(jsCode);
end;
jorgo
 
Posts: 108
Joined: 13 Jul 2016 15:57

by Alexander Bulei » 03 Nov 2016 17:54

Hi jorgo,

Check the attached demo ;)

Best Regards.
You do not have the required permissions to view the files attached to this post.
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.