|
<< Click to Display Table of Contents >> Navigation: Forum > TIWTemplateProcessor - at runtime |
02-10-2024, 04:59 AM:
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?
Thanks
- Lou
02-12-2024, 11:47 AM:
I'm doing
Code:
IWTemplateProcessorHTML1.MasterTemplate := 'IWFormBase.html';
AsyncReload(true);
However, I believe there must be a better solution. This, of course affect whole page, not the region.
02-15-2024, 01:39 AM:
Code:
IWTemplateProcessorHTML2.Templates.Default := 'change.html';
AsyncRenderComponent(IWRegion1);
u can try AsyncRenderComponent (Usable at TIWAppForm level), but I am unsure if it is safe to use.
02-19-2024, 04:30 AM:
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:
Code:
IWTemplateProcessorHTML2.Templates.Default := 'change.html';
IWRegion1.RefreshAsyncRender;
Stay tuned!
02-22-2024, 08:27 AM:
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,