Atozed Forums
Dynamic body change - 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: Dynamic body change (/thread-2660.html)



Dynamic body change - VampireKB - 03-07-2022

Hello all !
is it possible to change body of http throw intraweb ? 

as an example:
i have a static template
<html>
<body>
#1
#2
#3
<body>
<html>

and i want to replace #1 with my data  and show it to user...

(searched all examples on git and help docs...)


While it get an approvement i already find an answer and have a problem #2 ))

i'm using IWTemplateProcessorHTML>>onunknowntag to create info i needed
and now i need to return info back into intraweb ,...

i tryied to copy function from DBGRID ( <a HREF="#" OnClick="return SubmitClickConfirm('IWDBGRID1','0_name', true, '');">name</a> ) but it do nothing... )



Self answer...
at template add:

<script>
function Submitrowdata(e) {
var a=e
ajaxCall( "Submitrowdata","id="+a )}
</script>

At form "OnCreate" add:


RegisterCallBack('Submitrowdata',
procedure (aParams: TStrings; out aResult: string)
begin
IWMemo1.Lines.Add(aParams.Values['id']);
end
);


RE: Dynamic body change - Alexandre Machado - 03-16-2022

You can replace content of the DOM and this includes changing the BODY tag content yourself. However if you render INPUT controls you will need to take care of them yourself... the "glue" between the browser and the server, for each control rendered is given by IntraWeb javascript which handles everything for you under the hood. If you do that yourself, you won't have this help from IW javascript code