CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Problem with RenderRegionAsync

Questions & Answers about IWCGJQuery Suite.

by Corwin » 30 Jul 2015 11:53

Hi

I have a frame with an object scheduler (see attachment)

pressing a button I create a report (IWCGJQButtonSalvaJQButtonOptionsClick).

I want to make a warning or a barprogress when creating the report.
In the method ReportProgress I try but the progress bar does not appear.
I tried it with a notification that I open the prim report.run, but not working.

both (progressbar and notification) appear only performing IWCGJQFileDownload.DownloadFileName (FileName);

What is wrong?

Regards.
You do not have the required permissions to view the files attached to this post.
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Jorge Sousa » 30 Jul 2015 14:58

Hello

All you are doing in IWCGJQButtonSalvaJQButtonOptionsClick

it's always on server side, never goes to browser to do anything, all that you do with controls its going to generate javascript, that will be executed at once, when the event backs to browser.

You've to use IWTimer to update the controls.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Corwin » 30 Jul 2015 15:06

Hello Jorge

how should I use the timer? you have an example?

Regards.
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Jorge Sousa » 30 Jul 2015 15:32

The TIWTImer is an Intraweb native control

you must see Intraweb examples.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Corwin » 05 Aug 2015 14:48

Hi Jorge
from another topic (problem Region async updater)

"by Jorge Sousa » 09 Jul 2013 13:16
Hi

Yes it's in server side, I remind you that you need to use RenderRegionAsync, only for things that aren't possible to do with normal properties change, for instance, clearing and adding items on a JQComboBox.

There is no such event, all you have to do is:

CGCallbackDisableAjaxResponse;
try
button1.enabled := false;
button2.enabled := false;
finally
CGCallbackEnableAjaxResponse;
end;
RenderRegionAsync(Region,False,True);

RenderRegionAsync, replaces the current browser region (and child controls) html by a new html, using jquery.

Best Regards

cgdevtools"


in attachment i simple project... button not works, so i have two TIWCGJQedit objects and in in onasyncexit method I tried to make a visible image as your example ... does not work ...

can you tell me what's the problem?

Regards.
You do not have the required permissions to view the files attached to this post.
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Jorge Sousa » 05 Aug 2015 17:20

Hello

2 things

1 -
button not works


What do you mean, did you debug it and put a breakpoint there?

2-
I tried to make a visible image as your example ... does not work ...


Do you know what the Intraweb property RenderInvisibleControls: Boolean does?

Try to set IWFrameRegion.RenderInvisibleControls = True

(I know, this property should always be True, makes no sense to be False)
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Corwin » 06 Aug 2015 08:32

Hi Jorge

1

obviously I tried debugging ... never enters functions click

2
Ok
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Corwin » 06 Aug 2015 09:04

another question...

i have a iwregion in a TIWCGJQScheduler;
when I press a button, create a print; APrinting before I would bring up the region with the image, after the creation of the press make invisible the region with the image. The problem is that I see the region ONLY when the window appears to download ...

Code: Select all
procedure TCGIWJQSchedulerFrame.IWCGJQButtonSalvaJQButtonOptionsClick(
  Sender: TObject; AParams: TStringList);
begin
......
              if OraQuerySched.recordCount > 0 then
              begin
                XLSAdapter1.AllowOverwritingFiles := true;
                Report.FileName:=fileN;

 [b]               CGCallbackDisableAjaxResponse; 
                IWCGJQRegion2.Visible := True;  // Region with image
                IWImage1.Visible := True;             // Image in IWCGJQRegion2
                CGCallBackEnableAjaxResponse;
                RenderRegionAsync(IWCGJQRegion2,rramLazyLoadMethod,True);[/b]

                Report.Values['current_date'] := Now;
                Report.Run;  // create report
                info('Info --> Session  %s - Lanciata stampa Scadenziario ( %s ) Anno %s ',[UserSession.NrAppId , fileName, IWCGJQEditAnno.Text]);
                test := WebApplication.ApplicationPath + 'ExpPdf.exe ' + FileName + ' ' + FileNamePdf;
                //esito := ShellExecute(0, nil, PChar(WebApplication.ApplicationPath + 'ExpPdf.exe '),PChar(FileName + ' ' + FileNamePdf ), '', SW_HIDE);
                ExecuteAndWait(test);      // Converting EXCEL -> PDF
[b]                CGCallbackDisableAjaxResponse;
                IWImage1.Visible := False;
                IWCGJQRegion2.Visible := False;
                CGCallBackEnableAjaxResponse;
                RenderRegionAsync(IWCGJQRegion2,rramLazyLoadMethod,True);[/b]

                if FileExists(FileNamePdf) then
                   IWCGJQFileDownload.DownloadFileName(FileNamePdf)
                else
.....
end;


Some idea?

Regards
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Jorge Sousa » 06 Aug 2015 09:40

Hello

Code: Select all
 [b]               CGCallbackDisableAjaxResponse; 
                IWCGJQRegion2.Visible := True;  // Region with image
                IWImage1.Visible := True;             // Image in IWCGJQRegion2
                CGCallBackEnableAjaxResponse;
                RenderRegionAsync(IWCGJQRegion2,rramLazyLoadMethod,True);[/b]


1- You don't need CGCallbackDisableAjaxResponse, CGCallBackEnableAjaxResponse and RenderRegionAsync for this.

2- use CGCallbackDisableAjaxResponse and CGCallbackDisableAjaxResponse it only when create new frames.
use RenderRegionAsync when the opearations envolved are not supported, which is not the case of IWCGJQRegion2.Visible:= True
When you use a control visibility change, make sure its parent has RenderInvisibleControls = True.

3- We told you before, when you call code like IWCGJQRegion2.Visible:= True, the server doesn't call the client to operate, for executing IWCGJQRegion2.Visible := False; after

all you are doing is adding javascript to be executed when the event returns to browser. In this case will set the javascript correspondant to

IWCGJQRegion2.Visible:= True and IWCGJQRegion2.Visible:= False at once, resulting in the invisibility.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58


Return to Q & A

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.