THandlers and Menu

<< Click to Display Table of Contents >>

Navigation:  Forum >

THandlers and Menu

Forum link

 


 

07-30-2021, 08:30 AM:

 

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> !!!!

 


 

07-30-2021, 06:21 PM:

 

<li><a href="/form1">Form 1</a></li>

 

<li><a href="/form2">Form 2</a></li>

 


 

08-02-2021, 05:04 AM:

 

(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?

 


 

08-03-2021, 04:55 AM:

 

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