Having the component loop working for a form, I want to use it to change some properties for individual components, based on user prefs.
How can I check for the presence of a certain property, like font, which is not something all components have ?
Using "if (selv.Components[i] as TIWCustomControl) is TIWLabel ..." requires IWCompLabel to be present in the Uses clause.
If I want to check if the component has a font property, how can I do that without refering to the component type ?
And will it be possible to set, say font.size, for all IWLabels, IWButtons and IWEdits on the form, without having to include all the types in the uses clause ?
I'm trying to create a general procedure I can call in each forms create event, to avoid having to put all the code in every form.
I'm trying to implement a general style sheet, so that all elements have the same font family and font size, and wonder if it is sufficient to define which style sheet to use, in ServerController. If style sheet is not defined for other forms, will they all forms in the projct use the sheet defined for ServerController ?
OR.. is it necessary to specifically define a style sheet for each form ?
Hi,
1) Installed IW 15.1.5 ( iw15.1.5.exe )
2) Copy source code ( content of IWSource15.1.5_20190914.zip ) on same directory, now I have this structure:
With Delphi RIO 10.3.2,
Open Design\Intraweb_15_D10_3.dproj, build => OK
Open Design\dclIntraweb_15_D10_3.dproj, build => KO, error:
"[dcc32 Fatal Error] dclIntraweb_15_D10_3.dpk(65): F1026 File not found: '..\..\private\design\IWDsnFormWebsite.pas'"
dclIntraweb_15_D10_3.dpk(65): Unit 'IWDsnFormWebsite' is used by 'IWRegister'error
And I see that all \private\design\*.* file are missing...
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