Atozed Forums

Full Version: TIWTemplateProcessor - at runtime
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
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.
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!
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,