Show TOC

Mobile EventsLocate this document in the navigation structure

In addition to the general browser and control events you can access specific events for touch-enabled devices.

The following is the same for mobile and desktop events:

  • When running on mobile or touch devices, the application has still the possibility to access to all native browser events, including the touch-related ones.
  • Handling of control events fired by SAPUI5 is also the same as on desktop PCs.
  • When implementing SAPUI5 controls, some browser events can be handled very easily by implementing a method named on<eventName>, so all the bind/unbind effort is avoided. This is equally possible on mobile.

On touch-enabled platforms additional browser and pseudo events are available:

Additional Mobile Browser Events

On touch-enabled platforms the following events are also provided within UI5 controls to be handled in on<eventName> methods:

  • touchstart
  • touchend
  • touchmove
  • touchcancel
Additional Mobile Pseudo Events

jQuery mobile event handling is used in SAPUI5 when running on touch-enabled devices. From the basic browser events it creates semantically richer events. Some of them are also provided automatically in SAPUI5 controls:

  • swipe
  • tap
  • swipeleft
  • swiperight
  • scrollstart
  • scrollstop

For more information, see jQuery mobileInformation published on non-SAP site.

Windows 8

With Microsoft Windows 8 devices are introduced that allow user interaction with both mouse and touch. To be able to react to both kind of events, some new functionality was introduced.

For more information, see Windows 8 Support

Simulation of touch events on non-touch platforms

For testing or demonstration purposes, the events listed above can also be simulated on non-touch devices. When this simulation is enabled, the touch events will also be triggered by mouse interaction.

Caution Due to technical constraints the simulation cannot be perfect, so it may not be used productively.

To enable the simulation mode, set the SAPUI5 configuration parameter xx-test-mobile to <true>, for example by appending the URL parameter sap-ui-xx-test-mobile=true.