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:
| Event |
Permitted Tags |
Description |
| 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
Attributes
class
The optional class core attribute is used to assign one or more classes to the element.
Multiple classes are separated by white space.
The class name is case sensitive (i.e., Stocks and stocks are not the same).
id
The optional id core attribute is used to assign a unique name to a tag.
The name must be unique to the entire deck and not just unique to a card.
The first character of the name can be a letter or the underscore.
The remaining characters can be any combination of letters, numbers, or underscores.
type
The mandatory type attribute specifies the name of the type of the event.
There are four permitted values: onenterbackward, onenterforward, onpick,
and ontimer.
This example uses the onevent tag to always navigate to card3 when a
onenterbackward event occurs.
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>
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information
|