Refresh template - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: Refresh template (/thread-2507.html) |
Refresh template - matija - 09-15-2021 My case: with THandlers.Add('', 'form1', TContentForm.Create(TForm1)) do begin CanStartSession := true; RequiresSessionStart := false; end; with THandlers.Add('', 'form2', TContentForm.Create(TForm2)) do begin CanStartSession := true; RequiresSessionStart := false; end; Both Forms have mastertemplate.html. I this template dynamic Javascript in div create Bootstrap mega menu depending of language user. mastertemplate.html <div id="menu"></div> WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA fill this div with timer in tform1 and tform2. This work. I can not refresh this template OnCreate or OnShow thats why timer in form. <div id="menu"> <ul> <li><a href="form1">Form1</a></li> <li><a href="form2">Form2</a></li> </ul> </div> RefreshTemplate function is define in UserSession and run in timer individual form. If i have open Form1 and click again link to form1 then load mastertemplate empty div for menu! Is a change only refresh mastertemplate for all forms? RE: Refresh template - Jose Nilton Pace - 09-15-2021 Hi, you can send directly to your id, something like this: Code: WebApplication.CallBackResponse.AddJavaScriptToExecuteAsCDATA( RE: Refresh template - matija - 09-15-2021 (09-15-2021, 02:30 PM)Jose Nilton Pace Wrote: Hi, you can send directly to your id, something like this: So it already works! This is not problem. Have to change my mastertemplate.html in usersession before create and show my form with my exist refresh function. Template is not completed because user language. Have easy access to my mastertemplate.html that usersession with my Refresh function (include AddJavaScriptToExecuteAsCDATA)? |