Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
THandlers and Menu
#1
Used HTML template.

My form add to ServerController with:
THandlers.Add('', 'MainForm', TContentForm.Create(TMyMainForm));

THandlers.Add('', 'Form1', TContentForm.Create(TMyForm1));
THandlers.Add('', 'Form2', TContentForm.Create(TMyForm2));

Link with:
http://localhost/form1
http://localhost/form2

Delphi generation my links (<a href="">Linki1</a>) to mastertemplate.html in {%MyMenu%}.

MyMenu.Caption:
<ul>
    <li><a href="form1">Form 1</a></li>
      <li><a href="form2">Form 2</a></li>

</ul>

How do i get my link from THandels to href?

<li><a href="' + IWServerController.THandels[1] + '">Form 1</a></li> !!!!
Reply
#2
<li><a href="/form1">Form 1</a></li>
<li><a href="/form2">Form 2</a></li>
Reply
#3
(07-30-2021, 06:21 PM)kudzu Wrote: <li><a href="/form1">Form 1</a></li>
<li><a href="/form2">Form 2</a></li>

This in correct. I woudle like this name/link (form1, form2) somehow from THandels?
Reply
#4
The handler does not hold this information, because 1 handler can be connected to multiple paths.

Besides that, multiple handlers can match a specific request (and there is an order to resolve the precedence).

So, bottom line is that your application must "know" this information somehow
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)