Page tree
Skip to end of metadata
Go to start of metadata

This guide explains how to use the Page object into your project.

Basics and Events

The Page is a standard layout which is used after the application starts. The Main Page (page1 ) is added to every project by default and it can be changed from app.js.

The Page has standard events like any page object. These are;

NAMEDESCRIPTION
onClose
Creates action(s) that are run when the page is disappeared
onControlAdded
Fired when a child control (for each control) is added (Fired after added)
onControlRemoved
Fired when a child control (for each control) is removed (Fired after remove)
onKeyPressed
Creates action(s) that are run when the user presses the key of the devices.
onOrientationChanged
Creates action(s) that are run when the orientation is changed.
onShow
Creates action(s) that are run when the page is appeared

The Navigation between pages is simple. 

var myPage = Pages.mypage = new SMF.UI.Page({
		name : "Page1",
		onShow : function (e) {
			myPage2.show();
		}
	});
var myPage2 = Pages.mypage = new SMF.UI.Page({
		name : "Page2",
		onShow : function (e) {
			alert("Page name : " +this.name);
		}
	});
myPage.show();