Web Application - Device Property

Device type on which the application is executing

Member of Web Application (PRIM_WEB.Application)

Data Type - Enumeration

Details

The Device property identifies the size of the device on which the application is running based on the pixel width.
 
The DeviceChanged event will fire whenever there is a change of device e.g. a Browser is resized.

Allowed Values

Enum ValueDescription
DesktopGreater than 1200 pixels
MobileLess than 800 pixels
TabletBetween 800 and 1199 pixels

 

Example

In this example, a different layout is applied based on the Device.
Evtroutine Handling(#Sys_Web.DeviceChanged)
 
   Case (#Sys_Web.Device)
 
   When (= Desktop)
      #Com_owner.Layout <= #LayoutDesktop
 
   When (= Mobile)
      #Com_owner.Layout <= #LayoutMobile
 
   When (= Tablet)
      #Com_owner.Layout <= #LayoutTablet
 
   Endcase
 
Endroutine

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020