Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
start the application with a differente presentation depending on the device model
#3
You can use ServerController.OnGetMainForm event.

This event triggers just before rendering the first form for that session. The session has already been created and you have all information for it:

Code:
procedure TIWServerController.IWServerControllerBaseGetMainForm(var vMainForm: TIWBaseForm);
var
  WebApp: TIWApplication;
  w, h: Integer;
  isMobile: Boolean;
begin
  WebApp := gGetWebApplicationThreadVar;
  if Assigned(WebApp) then
  begin
    w := WebApp.FormWidth;
    h := WebApp.FormHeight;
    isMobile := WebApp.Browser.IsMobile;
  end;
end;

Then, based on this information you can set vMainForm variable to the specific form to handle that client.
Reply


Messages In This Thread
RE: start the application with a differente presentation depending on the device model - by Alexandre Machado - 01-21-2021, 11:11 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)