14. WML Events and the <onevent> Tag
WML supports events and it provides a tag pair, <onevent></onevent>, for handling events. You can specify an action to be taken whenever an event occurs. Four events are supported in WML.
ontimer -- This event occurs when a timer expires.
onenterbackward -- This event occurs when a user goes back to a card through the WAP browser's URL history.
onenterforward -- This event occurs when a user goes to a card in the forward direction. For example, if a user goes to a card by entering its URL directly in the WAP browser, the onenterforward event will be triggered.
onpick -- This event occurs when an item of a selection list is selected or deselected.
The <onevent></onevent> tags are used to create event handlers. Its usage takes the following form:
A single task to be done whenever the event occurs
Tasks that are allowed to be placed between the <onevent> and </onevent> tags include <go>, <prev> and <refresh>. You have seen the <go> and <prev> elements before. We will describe how to use the <refresh> element when we cover variables in this tutorial.
|Previous Page||Page 27 of 50||Next Page|
- 1. WML (Wireless Markup Language) Introduction
- 2. WML Deck and Card
- 3. WML Document Structure
- 4. WML Generic Metadata: <meta>
- 5. Comments in WML
- 6. Line Breaking in WML
- 7. Font Size and Style in WML
- 8. WML Preformatted Text: <pre>
- 9. WML Images
- 10. WML Tables
- 11. WML Anchor Links
- 12. Programming Softkeys of Mobile Phones and the <do> Element
- 13. WML Template and Menu
- 14. WML Events and the <onevent> Tag
- 15. Timer and the ontimer Event
- 16. WML Event: onenterbackward
- 17. WML Event: onenterforward
- 18. WML Selection Lists and the onpick Event
- 19. WML Input Fields
- 20. WML Variables
- 21. Submitting Form Data to the Server in WML
- 22. Clearing a Saved Form in WML