CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

IWCGJQRegion

by etwoss » 04 Aug 2014 11:38

Hi

My form is already shown.
A thread terminates and a region has to make visible:

procedure TIWFormToken.DoSimpleWaitThreadTerminate(Sender: TObject);
begin
if (FShowDialog) then
begin
IWCGJQRegion.Visible := True;
end;
end;


I can't call IWCGJQRegion.AjaxRerender() , but how can i make the region visible?

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by dfields » 04 Aug 2014 11:48

If this is being done asynchronously, then you have to call RenderRegionAsync(). You have to add IWCGAsyncRender to your uses clause.

Code: Select all
procedure TIWFormToken.DoSimpleWaitThreadTerminate(Sender: TObject);
begin
 if (FShowDialog) then
 begin
  IWCGJQRegion.Visible := True;
  RenderRegionAsync(IWCGJQRegion);  //or call it for the parent region if needed
 end;
dfields
 
Posts: 130
Joined: 24 Jul 2013 20:14

by etwoss » 04 Aug 2014 11:59

Hi

This does not work because its not in Ajax Processing

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Jorge Sousa » 04 Aug 2014 12:01

Hi

This does not work because its not in Ajax Processing


Well said, you've to use IWTimer, checking if the thread it's terminated, and then update the browser, using any IW appliable method, including RenderRegionAsync
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by etwoss » 04 Aug 2014 13:12

Hi

The IWTimer is not async right?
I did put in codesite but the event OnTimer is not executed
Another process in the same vcl tread is the cause of this, takes to much time
Thats why i uses a thread

is there no way to refresh my form if its not aSync call?

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by etwoss » 04 Aug 2014 13:32

Hi

In this codesite log you see see the timer being enabled (set to 3 seconds)
However the call to GetServer takes so much processtime the OnTime event does not fire
Thats why i wanted to use a Thread and after the tread is terminated i needmake my Region visible and refresh the page.

So there is no way to just refresh the page outside an ajax call?

Eric
You do not have the required permissions to view the files attached to this post.
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Jorge Sousa » 04 Aug 2014 14:14

Hi

The IWTimer is not async right?


The OnAsyncTimer event is ajax/async yes.

So there is no way to just refresh the page outside an ajax call?


no there is not no other way.

browser has to call the web app, it's a client-server technology. server doesn't call the client at any time, but using a IWTimer, has the same results, only the programming is different.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by etwoss » 04 Aug 2014 14:21

Hi

Yes the Event is async, i know, but the event is not fired at all. This meaning the class TIWTimer is not running in another thread bit in the same VCL thread as my time consuming method.

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Jorge Sousa » 04 Aug 2014 14:52

but the event is not fired at all


why not?
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by etwoss » 05 Aug 2014 07:34

Tell me :-)
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

Next

Return to General

cron

Who is online

Users browsing this forum: No registered users and 14 guests

Contact Us.