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.

Listing calendars in Symbian Web Runtime

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Nokia 5800 XpressMusic
Platform(s): S60 5th Edition
S60 5th Edition
Keywords: device.getServiceObject(), Service.Calendar.GetList()
Created: tapla (16 Jan 2009)
Last edited: hamishwillee (05 Oct 2012)



This code snippet shows how to list calendars in Symbian Web Runtime using the Calendar Platform Service introduced in S60 5th Edition.

The device.getServiceObject("Service.Calendar", "IDataSource") method is used to obtain access to the service object for the Calendar Service API.

Source: Relevant HTML components

<label for="calendarList">Calendars:</label><br />
<select size="2" id="calendarList" onclick="showEvents();"></select>

Source: JavaScript file

var serviceObj = null;
window.onload = init;
// Initializes the widget
function init() {
// Obtain the service object
try {
serviceObj = device.getServiceObject("Service.Calendar",
} catch (ex) {
alert("Service object cannot be found.");
function listCalendars() {
try {
var filter = new Object();
// Not using the default calendar
filter.DefaultCalendar = false;
// Criteria for fetching calendars
var criteria = new Object();
criteria.Type = "Calendar";
criteria.Filter = filter;
// Get the list of calendars
result = serviceObj.IDataSource.GetList(criteria);
if (result.ErrorCode == 0) {
} else {
alert("Error in getting calendars");
} catch( exception ) {
alert("initialize error: " + exception);
function showCalendars(iterator) {
var calendarList = document.getElementById("calendarList");
// Empty the calendar list
while (calendarList.length != 0) {
// Set the pointer to the first element
var item;
while ((item = iterator.getNext()) != undefined) {
var node = document.createElement("option");
node.value = item;


Available calendars are displayed.

See also

Listing calendar entries in Symbian Web Runtime

This page was last modified on 5 October 2012, at 05:53.
42 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.