The ScreenOrientation Module controls the screen orientation and layout, and can register to receive an event when it changes.
|screenOrientation (Module) <META> Syntax|
<META HTTP-Equiv="ScreenOrientation" content="[orientation]">
<META HTTP-Equiv="ScreenOrientation" content="ScreenOrientationEvent:url('[jsFunction | url]')">
e.g. screenOrientation.autoRotate = 'value';
e.g. screenOrientation.screenOrientationEvent = 'doFunction(%json)';
To set multiple EMML parameters / events on a single line use the following syntax: screenorientation.setEMML("[Your EMML Tags]");
Items listed in this section indicate methods or, in some cases, indicate parameters which will be retrieved.
|normal||Sets the screen orientation to portrait||Device Dependant|
|rightHanded||Sets the screen orientation to righthanded (landscape). Note the webpage will not reformat in line with the new screen size automatically.||Device Dependant|
|leftHanded||Sets the screen orientation to lefthanded (landscape). Note the webpage will not reformat in line with the new screen size automatically.||Device Dependant|
|upsideDown||Sets the screen orientation to upside down, useful if presenting the device to a customer to obtain a signature.||Device Dependant|
Items listed in this section indicate parameters, or attributes which can be set.
|Name||Possible Values||Description||Default Value|
|autoRotate:[Value]||'Enabled' or 'Disabled'||Enables or Disables autorotation of the screen orientation when the device is rotated||Defined in Configuration File|
The screen orientation event is sent when the current RhoElements application changes the orientation of the screen. For devices with an inbuilt accelerometer this event will also be sent when the user physically rotates the device to a new orientation.
|1||orientation||Either 'normal', 'rightHanded', 'leftHanded' or 'upsideDown'|
When multiple RhoElememts applications are running the following considerations should be made: The screen orientation settings are application specific. Switching to another application which uses the ScreenOrientation module will cause the screen to be rotated automatically if necessary
When the screen orientation changes, either using the ScreenOrientation tag or by rotating a device with hardware support, the command areas will automatically move and resize to fit the new layout. However the buttons themselves are not moved and in some cases this may result in them being off the screen or not in the expected position. If so they must be moved manually by detecting the ScreenOrientationEvent.
In all devices apart from the Enterprise Tablet, orientation changes will persist if RhoElements is closed or the device is warm booted.
By default the Screen Orientation module will assume the "Normal" orientation of your device is portrait mode. Devices which default to landscape mode (e.g. VC model devices) may need to be set to "leftHanded" in order to achieve an 'out of the box' orientation.
|RhoElements Version||1.0.0 or above|
|Supported Devices||All supported devices. autoRotate is only supported in devices that have IST.|
|Minimum Requirements||A device with a screen.|
|Persistence||Partially Persistent - Changes to this module will persist when navigating to a new page with the exception of ScreenOrientationEvent|
The following example orients the screen to "right-handed" in landscape mode:
<META HTTP-Equiv="ScreenOrientation" Content="RightHanded">