ONEVENT
and TEMPLATE
Tags
ONEVENT
Tag
<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 given in the following table.
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 back 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 |
TEMPLATE
Tag
<template>
element can occur per deck.
This tag can only be contained in a <wml>
element.
It can only contain <do>
and <onevent>
elements.
The individual <card>
elements can override the behavior specified by the <template>
element.
The behavior specified in a <template>
element by a <do>
element can be overridden in a <card>
element by another <do>
element, but only if both <do>
elements have the same name for the <name>
attribute.
Likewise, the behavior specified in a <template>
element by an <onevent>
element can be overridden in a <card>
element by using the onenterbackward
, onenterforward
, and ontimer
attributes.