WML » Tags » onevent

Syntax:
<onevent> ... </onevent>

The onevent tag serves as a container for code that you wish to be executed automatically when one of the four intrinsic events occurs. The onevent element is said to bind (associate) the tasks (code) to the event for the element.You must specify the intrinsic event by using the mandatory type attribute.

The four intrinsic events are:

EventPermitted TagsDescription
onenterbackward card or template Occurs when a prev navigates back into a card
onenterforward card or template Occurs when a go navigates into a card
onpick option Occurs when an item is selected or unselected by a user
ontimer card or template Occurs when the timer expires


Note: The template element creates code that is inserted into all cards in a single deck.
 
Nested Tags:  go  noop  prev  refresh

Examples

Code:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.WAPforum.org/DTD/wml_1.1.xml">
<wml>

<template>
   <onevent type="onenterbackward">
      <go href="#card3" />
   </onevent>
</template>

<card id="card1" title="Card 1">
<p>
   <a href="#card2">
Go to Card 2</a>
</p>
</card>

<card id="card2" title="Card 2">
<p>
DevGuru</p>
</card>

<card id="card3" title="Card 3">
<p>
is great!</p>
</card>

</wml>
Explanation:

This example uses the onevent tag to always navigate to card3 when a onenterbackward event occurs.

Language(s): WML

See Also: