CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Show modal JQDialog (unit2) over IWForm1 (unit1)

by assapan » 11 Nov 2016 17:58

Let me give you a warning jorgo , please don't use variable in units , move them to object.

your example
Code: Select all
UNIT4.myFrameDialog := TIWCGJQFrame4.Create(self);
use a variable in the shared space by all the users connected .....

It is better to move the variable in currentform or in usersession .

my 2 cents
Want to visit Ardeche http://leclosdelarc.fr/index.php
The Pont d’Arc Cavern http://en.cavernedupontdarc.fr
Image
User avatar
assapan
 
Posts: 600
Joined: 16 Dec 2013 12:04
Location: France

by jorgo » 15 Nov 2016 15:50

Yes, you're right.
jorgo
 
Posts: 108
Joined: 13 Jul 2016 15:57

by jorgo » 21 Nov 2016 16:35

Hallo,
now I want to call the modal dialog from a standard IntraWeb&TMS form.

Code: Select all
type
  TIWCGJQFrame4 = class(TIWCGJQFrame)
    IWFrameRegion: TIWCGJQDialog;

procedure TIWForm1.IWTimer1Timer(Sender: TObject);
begin
  IWTimer1.Enabled := False;

  FRM := TIWCGJQFrame4.Create(WebApplication);
  FRM.Parent:= WebApplication.ActiveForm as TWinControl;
  FRM.Name := CGFindUniqueComponentName(Self,'ModDialog16');
  FRM.IWFrameRegion.AjaxReRender;
end;


If I set the parent to this activeForm the modal dialog is killed by this form.
Only input fields are shown non modal.
(I know this form is awfull, but I can't change it)

Now I need a trick.
Is there a posibility to set another parent?
The modal dialog should be shown "modal" on the topmost position.
Maybe "WebApplication.DefaultWindow" or ???

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

by assapan » 21 Nov 2016 19:10

Hi Jorgo,
I think you might have a look to CGDevtools demo source Components.pas

Code: Select all
procedure TIWComponentForm.ShowFrame(AFrameClass: TIWCGFrameClass; AParams: TStringList);
var
  IsAsync: Boolean;
begin
  if not Assigned(AFrameClass) then Exit;

  CGJQTabs.ActiveTab:= IWCGTabDemo;

  IsAsync:= CGIsCallBackProcessing;
  if IsAsync then
  begin
    // SINCE THE FRAME IS GOING TO BE RENDERED BY AJAX, DON'T NEED TO GENERATE AJAX RESPONSE.
    CGCallBackDisableAjaxResponse;
  end;
  try
    CreateNewFrame(AFrameClass);
    FrameComp.ProcessCommand(0,AParams);
  finally
    if IsAsync then
    begin
      CGCallBackEnableAjaxResponse;
      RenderRegionAsync(JQRegContainer,rramOldMethod,True);
    end;
  end;
end;
Want to visit Ardeche http://leclosdelarc.fr/index.php
The Pont d’Arc Cavern http://en.cavernedupontdarc.fr
Image
User avatar
assapan
 
Posts: 600
Joined: 16 Dec 2013 12:04
Location: France

by jorgo » 22 Nov 2016 10:06

Hi,
I tested an IWCGMessageDlg.
In a test app it's working well.
On this bad form only "Hello world" is displayed in the left, top corner.
The modal dialog is destroyed and disappeared.

Code: Select all
procedure TIWForm2.IWCGJQButton2JQButtonOptionsClick(Sender: TObject; AParams: TStringList);
var
  tempDlg: TIWCGJQMsgDialog;

begin
  tempDlg := IWCGMessageDlg('Hello world', mtConfirmation, [mbYes, mbNo], NIL);
end;


A simple "WebApplication.ShowMessage('Hello world');" is runing.

Is there a way to conceal my cgdevtools modal dialogs from this wolfish form?

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

by Alexander Bulei » 23 Nov 2016 12:08

Hi jorgo,

Sincerely, I don't understand your problem...

Please, provide me the simple testcase. T.I.A

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

Previous

Return to JQDialogEx

Who is online

Users browsing this forum: No registered users and 4 guests

Contact Us.