Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Revision as of 06:20, 12 October 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Using SubMenu in Widget

From Wiki
Jump to: navigation, search

This code snippet shows how the submenu can be used in Symbian Web Runtime.

Article Metadata
Tested with
Devices(s): Nokia N96
Platform(s): S60 3rd FP2,S60 5th Edition
S60 5th Edition
S60 3rd Edition FP2
Keywords: submenu
Created: ck.umraliya (06 Jan 2009)
Last edited: hamishwillee (12 Oct 2012)

Source file: index.html

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
<script type="text/javascript" src="basic.js"></script>
<script type="text/javascript" src="WRTKit/WRTKit.js"></script>
<style type="text/css">
@import url("basic.css");
<body onload="makemenu()">

Javascript File

//Creating Menu Id's
OP1 = 100
OP2 = 101;
OP3 = 102;
OP4 = 103;
OP5 = 104;
// Function which creates option menu
function makemenu()
// Create a Menu item
m1 = new MenuItem('MenuOptions1', OP1);
// Append Menu item to option Menu;
// Create three more Menu items for Sub-Menu
m11 = new MenuItem("option1", OP3);
//assign select handlings
m11.onSelect = onsubMenuSelect;
//append to menu
m12 = new MenuItem("option2", OP4);
m12.onSelect = onsubMenuSelect;
m13 = new MenuItem("option3", OP5);
m13.onSelect = onsubMenuSelect;
// function that handles select operation of submenu items
function onsubMenuSelect(id)
switch (id)
case OP3:
//do something
case OP4:
// do something
case OP5:
// do something



This page was last modified on 12 October 2012, at 06:20.
57 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.