your example
- Code: Select all
UNIT4.myFrameDialog := TIWCGJQFrame4.Create(self);
It is better to move the variable in currentform or in usersession .
my 2 cents
UNIT4.myFrameDialog := TIWCGJQFrame4.Create(self);
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;
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;
procedure TIWForm2.IWCGJQButton2JQButtonOptionsClick(Sender: TObject; AParams: TStringList);
var
tempDlg: TIWCGJQMsgDialog;
begin
tempDlg := IWCGMessageDlg('Hello world', mtConfirmation, [mbYes, mbNo], NIL);
end;