CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

FileUpload and frames

by George » 16 Jan 2015 12:40

Hello!

Last few days i'm looking for problem related to FileUpload, Frames, Dialogs and HTMLTemplates.
To be able use same codebase as well as design and UI behavior i've created dialog with FileUpload.
So, currently i have 3 places where i calling my dialog to handle file upload. Great code re-usage i must say.

There was huge problems, related to mixed usage of frames, ajaxrerender and HTMLTemplates.
Good news, i found workarounds :) So almost all works fine except one thing.
I have main frame, 2 subframes and dialog frame.
dialogframe.owner = MainFrame
Subframe1.owner = MainFrame
Subframe2.owner = MainFrame

I'm going to Subframe1, then to Subframe2, opening upload dialog, starting file upload and closing dialog.
But if then i go to Subframe1, FileUpload stops upload and looses upload file list.
As you can see, there is no dialogframe rerendering in this case, but upload stops...

Demo

IW14.0.32, CG2.4.0.119, DXE6
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by Alexander Bulei » 16 Jan 2015 15:39

Hi George,

As you can see, there is no dialogframe rerendering in this case, but upload stops...


Are you sure???

You call this code on back button :

delphi code
TIWCGJQFrame1(Self.Owner).ShowSubframe1;


And this procedure have this:

delphi code
procedure TIWCGJQFrame1.ShowSubframe1();
begin
CGCallBackDisableAjaxResponse;
try
Subframe1.Visible := True;
Subframe2.Visible := False;
finally
CGCallBackEnableAjaxResponse;
end;
IWFrameRegion.AjaxReRender();
end;


You are rerender the IWFrameRegion region, and what is the parent of DialogFrame??

delphi code
procedure TIWCGJQFrame1.IWCGJQFrameCreate(Sender: TObject);
begin
Subframe1 := TIWCGJQFrameSubframe1.Create(Self);
Subframe1.Parent := IWFrameRegion;
Subframe2 := TIWCGJQFrameSubframe2.Create(Self);
Subframe2.Parent := IWFrameRegion;
Subframe2.Visible := False;
DialogFrame := TIWCGJQFrameDialog.Create(Self);
DialogFrame.Parent := IWFrameRegion;
end;


Do you understand what happens here?

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 George » 16 Jan 2015 16:04

Are you sure???

I was. Sorry for my inattentiveness :oops:
Now i created 2 subcontainers, one for SubFrames another for dialog to avoid dialog rerendering. Works...

Thank you very much!
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by George » 19 Jan 2015 17:14

I found memory leak with class: TIWCGJQUploadingFileList.
I updated CG to latest beta build and a little bit changed previous demo (almost all code was removed), new url.

Leak present in stable release too.
Hope, this demo will be useful.
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow


Return to JQFileUpload

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.