Atozed Forums
Changing TIWForm based on URL? - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software (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: Changing TIWForm based on URL? (/thread-4420.html)



Changing TIWForm based on URL? - CharCoil - 08-15-2024

Is there a simple way to pick IWForm to load based on URL?


RE: Changing TIWForm based on URL? - magosk - 08-21-2024

We use this server controller event in one of our web applications, see code. Hope this is what you need.

Best regards

Magnus Oskarsson

Code:
procedure TEmIndClientServerController.IWServerControllerBaseGetMainForm(var vMainForm: TIWBaseForm);
begin
  inherited;
  if not ServerIsMaster then {Slave mode}
    vMainForm := TSlaveModeMainWebForm.Create(WebApplication)
  else if WebApplication.RunParams.IndexOfName('s') >= 0 then {Response web link}
    vMainForm := TEmIndClientCalloutMessageWebDialog.Create(WebApplication)
  else if WebApplication.RunParams.IndexOfName('k') >= 0 then {App Alert activation}
    vMainForm := TEmIndClientAppAlertActivationWebForm.Create(WebApplication)
  else if WebApplication.RunParams.IndexOfName('l') >= 0 then {Password retrieval}
    vMainForm := TGenClientRetrieveIndividualPasswordWebDialog.Create(WebApplication)
  else if WebApplication.RunParams.IndexOfName('i') >= 0 then {Set availability}
    vMainForm := TEmIndClientSetAvailabilityWebDialog.Create(WebApplication)
  else
    vMainForm := TBaseIndClientLoginWebDialog.Create(WebApplication);
end{procedure};