Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make a Delphi Intraweb IWFrames work with IWTemplateProcessorHTML?
#1
Hi all...
this is my first post I guess..

I'm using Delphi 11.3 with IW15.

I have multiple iwframes, using them as a body of my page beside a header and a footer. everything is working great until I decided to use IWTemplateProcessorHTML.

My problem is that each iwframe has a IWFrameRegion which cannot be renamed for some reasons (I don't know why), although I tried to rename it various ways however it's not renamable! for that it's impossible to apply a template for each iwframe because it will have the same file name IWFrameRegion.html therefor it will work only for one iwframe only!
Another try was by adding another IWRegion and then easily rename it after that applying the IWTemplateProcessorHTML on it but in the end, it renders nothing! (empty page).

Hence, this is how I call the iwframe to display it inside the body region:
  if frm1 = nil then
    begin
      frm1 := TIWFrame2.Create(self);
      frm1.Parent := IWRegion1;
      frm1.Visible := true;
    end;

So how to solve this issue? is my approach wrong? or there is another way to apply IWTemplateProcessorHTML to an iwframe? 

I've also attached a simple file for the problem.

Thanks.


Attached Files
.zip   FramesTest.zip (Size: 74.25 KB / Downloads: 2)
Reply
#2
Hi Noobi$$,
I tried your testcase and not possible to fix it, I don't understand why (maybe to to the Delphi version, 10.4 in my case).
So I made a small test case which works fine for me, hope this is what you need, so please test it and let me know if it helps you.

The main differences between your version and mine are :
- the location and naming of the templates folder
- in IWTemplateProcessor HTML, you don't assign templats in property Templates/Default
- there's no template for frame 2

Have a look on my code and feel free to reach me out if you need more information.


Attached Files
.zip   MultiFrames.zip (Size: 28.38 KB / Downloads: 4)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)