Atozed Forums
Template and Components at Runtime - 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: Template and Components at Runtime (/thread-1507.html)



Template and Components at Runtime - Rolphy Reyes - 01-28-2020

Hi

I'm using Delphi Seattle and Intraweb 14.0.47.

I am trying to achieve the following, in a template I put a tag like this {%varmenu%} in runtime I generate the HTML tags like this:

Example
<li>{%myFrame.button1%}</li>
<li>{%myFrame.button2%}</li>

Of course I use the event OnUnknownTag from the TIWTemplateProcessorHTML component to replace the tag {%varmenu%}.

When running the application I was expecting to see the components but instead what I see is the name of the tags like this:
{%myFrame.button1%}
{%myFrame.button2%}

What am I missing?

Can someone help me out?

TIA


RE: Template and Components at Runtime - Jose Nilton Pace - 01-28-2020

Hi Rolphy.
When the OnUnknownTag occurs, the IW has gone through all the TAGs and it did not find this {%varmenu%}.
At this point you create NEW TAGS and IW DOESN'T know about them.
You must Generate the TAG {%varmenu%} already filled with all options, that is, all the HTML code.


RE: Template and Components at Runtime - Rolphy Reyes - 01-28-2020

(01-28-2020, 03:33 PM)Jose Nilton Pace Wrote: Hi Rolphy.
When the OnUnknownTag occurs, the IW has gone through all the TAGs and it did not find this {%varmenu%}.
At this point you create NEW TAGS and IW DOESN'T know about them.
You must Generate the TAG {%varmenu%} already filled with all options, that is, all the HTML code.

Hi Jose, thank you for your time.

I understand what you said and that is exactly what I don't know how to do.

Do you have an example?

I just know how to change the value of {%varmenu%} at the OnUnknownTag event, but I don't know how to tell  Intraweb that it needs to parse the new TAGS.

I'm very new at the HTML things.