in one of our web applications we have a base frame we use for showing modal dialogs. The base frame contains a TIWModalWindow component with IWFrameRegion as its ContentElement, as well as common code for logging and language support. In descendant frames we add visual elements, decide which buttons to use (e.g. OK & Cancel), add code to the ModalWindow.OnAsyncClick event handler etc. A using form creates such a frame (at runtime) when it wants to show it and calls a method ShowModal() of the frame (which sets Visible = True and calls ModalWindow.Show()). This has worked nicely.
Now we have a form where we want to be able to show more than one modal dialog (although not at the same time). You should be able to change data in the GUI of dialog 1, close it, open dialog 2, do some changes, close it and reopen dialog 1 with your earlier changes retained, etc. However, the rendering fails as soon as I try to open the second dialog. I have attached a simplified example project that demonstrates this. I have tried various things in the OnAsyncClose event handler such as setting Parent to nil for the frame, setting ModalDialog.ContentElement to nil, calling ModalWindow.Reset() etc. but with no luck.
Is there a way of having more than one modal dialog "in memory" like we want here? Has it something to do with multiple instances of the TIWModalWindow component? Please advice on what we need to change in order to solve this problem.
I am fighting with IWCGIRunner and until now it is the winner.
I created a simple "test.bat" and I have used a click sync of a iwbutton(IWBTNACAO) . The test.bat file has this content:
Code:
@echo off echo Content-type: text/plain echo. echo. echo Hi ! echo Your IP ADDRESS is %REMOTE_ADDR% and your BROWSER is %HTTP_USER_AGENT%"
First problem: IWCGIRunner is returning nothing.
Second problem: When sending a response to browser with WriteString I get an AV of "replytype already set"
Please, what is wrong?
Code:
procedure TF_MyForm.IWBTNACAOClick(Sender: TObject);
begin
var
CGIRunner: TIWCGIRunner;
CGIModuleName: string;
s: string;
begin
CGIModuleName := TIWAppInfo.GetAppPath + 'wwwroot\cgi-bin\test.bat';
CGIRunner := TIWCGIRunner.Create;
try
// Set the name of the CGI module which runs our report
CGIRunner.CGIModule := CGIModuleName;
CGIRunner.Execute(WebApplication, WebApplication.Request);
// Check status result. Zero indicates success. Anything else is an error
if CGIRunner.StatusResult = 0 then
begin
s:=CGIRunner.ResponseContent.Text;
//Problem here: CGIRunner.ResponseContent.Text is empty
with WebApplication.Response do
begin
ResetReplyType;
Code := 200;
ContentType := MIME_HTML;
WriteString(s); //Problem here: Here I get an AV about ReplyType already set
end
end else
begin
WebApplication.ShowMessage('Error on test.bat: ' + CGIRunner.ErrorMessage);
end;
finally
CGIRunner.Free;
end;
end;
end;
I have the component iwtemplate processor and html template. In html I <div id = "BACKGROUND" class = "container-fluid container-fullw bg-white no-border"> {% BSRightRegion%} </div>
to recall the rad component. In the form I have iwbootstrap components (3.4.1 and intraweb 15.1.4) (there are iwbsregion, iwbstext, iwbsbutton, iwbslist). When the form start (i have not written code i only assigned the template on iwproccessorhtml component) i have the following error
Error message: List index out of bounds (6)
This is the call stack
I recently updated a Win32 Delphi program from XE with IW 14.0.32 to 10.3.1 with the bundled IW 14.2.10 update after I requested a bundled key.
I am using TIWCalendar and it worked fine previously. However, since the move to Rio I am unable to change the WeekStarts property of the TIWCalendar to anything but wsMonday.
If I try to change it to some other day, the weeks on the calendar will still start on Monday.