Event

The event Object contains functions for dealing with specific events.


Code Example:
<html>
<head>
<title>WebWorks Pause Example</title>

<script type="text/javascript" charset="utf-8" src="webworks.js"></script>
<script type="text/javascript" charset="utf-8">

// Call onWebworksReady when WebWorks is loaded.
//
function onLoad() {
   document.addEventListener("webworksready", onWebworksReady, false);
}

// WebWorks is loaded and it is now safe to make calls WebWorks API
//
function onWebworksReady() {
   // Make sure "blackberry.app" is declared in config.xml if you intend to use the "pause" event
   blackberry.event.addEventListener("pause", onPause);
}

// Handle the pause event
//
function onPause() {
}

</script>
</head>
<body onload="onLoad()">
</body>
</html>


Supported Platform(s)

- BlackBerry 10
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
blackberry.event.addEventListener           Y 
blackberry.event.removeEventListener           Y 

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:

This API does not require a <feature> element to be declared in the configuration document of your BlackBerry WebWorks Application.

Permission Elements (PlayBook and BlackBerry 10+)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.

Functions

static void blackberry.event.addEventListener (eventName : String, yourCallbackFunction: function())


Allows you to attach a callback function to an event. You can attach multuple callback functions to a single event.


Supported Platforms
 - BlackBerry 10


Parameters
eventName The event you want to attach the callback function to.
yourCallbackFunction The callback function that will execute when the event occurs.

static void blackberry.event.removeEventListener (eventName : String, yourCallbackFunction: function())


Allows you to remove a callback function from an event.


Supported Platforms
 - BlackBerry 10


Parameters
eventName The event you want to remove the callback function from.
yourCallbackFunction The callback function that will be removed from the event.
Documentation generated by JsDoc Toolkit 2.4.0 on Mon Feb 11 2013 14:51:06 GMT-0500 (EST)