Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIWTemplateProcessor - at runtime
#1
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
Reply
#2
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.
Reply
#3
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.
Reply
#4
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!
Reply
#5
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,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)