Atozed Forums

Full Version: Changing TIWForm based on URL?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a simple way to pick IWForm to load based on URL?
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};