Atozed Forums
TIWTemplateProcessor - at runtime - Printable Version

+- Atozed Forums (
+-- Forum: Atozed Software Products (
+--- Forum: IntraWeb (
+---- Forum: English (
+----- Forum: IntraWeb General Discussion (
+----- Thread: TIWTemplateProcessor - at runtime (/thread-3876.html)

TIWTemplateProcessor - at runtime - lfeliz - 02-10-2024

I have a situation where I would like to use  TIWTemplateProcessor in a region, but be able to change the template applied based on a runtime condition (order type) set when user sets a value or in an onscroll event. 

In the past, before I got wise to templates, I would stack the regions and just show the one I wanted, but with templates, I can just expose the controls needed based on the type of order

What is best way to force the region to repaint using the updated template?

- Lou

RE: TIWTemplateProcessor - at runtime - swiatex - 02-12-2024

I'm doing

IWTemplateProcessorHTML1.MasterTemplate := 'IWFormBase.html';

However, I believe there must be a better solution. This, of course affect whole page, not the region.

RE: TIWTemplateProcessor - at runtime - RenSword - 02-15-2024

  IWTemplateProcessorHTML2.Templates.Default := 'change.html';
u can try AsyncRenderComponent (Usable at TIWAppForm level), but I am unsure if it is safe to use.

RE: TIWTemplateProcessor - at runtime - Alexandre Machado - 02-19-2024

We are about to release an update (15.5.7) that will allow you to do what you want in this case.

You will just need to call:

  IWTemplateProcessorHTML2.Templates.Default := 'change.html';

Stay tuned!

RE: TIWTemplateProcessor - at runtime - Alexandre Machado - 02-22-2024

Hi Lou,

please update to the latest IW 15.5.7 and use the code that I mentioned above. It will "just work"

Kind regards,