Skip to main content

SipaOnsenPage

SipaOnsenPage

SipaOnsenPage

Tool class with page loader with included router for OnsenUI

SipaOnsenPage.config : SipaOnsenPageConfig

Kind: static property of SipaOnsenPage

SipaOnsenPage.load(page_id, options)

Load given page by page_id

ParamTypeDefaultDescription
page_idstringto load
optionsObject
options.resetbooleanfalsereset page to given page
options.replacebooleanfalsereplace current page with given page. If reset=true is set, this option will be ignored
options.pushbooleanfalsestack given page over current page, independent if it exists already. If reset=true or replace=true is set, this option will be ignored
options.onsenOnsenOptionsoptions passed to original OnsenUI bringPageTop / pushPage / replacePage / resetPage
options.init_history_treebooleanfalseforce to load history tree, default false
options.paramsObjectparameters to be set at the new page
options.keep_paramsbooleantruekeep parameters when loading other page
options.anchorstringanchor to be set at the new page
options.keep_anchorbooleanfalsekeep current anchor when loading other page
options.remove_paramsArray.<String>parameters to be removed at the new page
options.successfunctionfunction to be called after successful loading
options.errorfunctionfunction to be called after loading fails
options.alwaysfunctionfunction to be called always after successful/erroneous loading

SipaOnsenPage.extractIdOfTemplate(template, options) string

Get the id only of the given template

Returns: string - absolute path

ParamTypeDefaultDescription
templatestringid or path of page or layout
optionsObject
options.typeSipaPage.PageType'page'

SipaOnsenPage.getClassNameOfTemplate(template, options) string

Get the class name of the given template

Returns: string - class name

ParamTypeDefaultDescription
templatestringid or path of page or layout
optionsObject
options.typeSipaPage.PageType'page'

SipaOnsenPage.typeOptions(type) TypeOptionsType

Get the options of the given type

Returns: TypeOptionsType - type options

ParamType
typeSipaPage.PageType

SipaOnsenPage.currentPageId() string

Get page id of current loaded page

Returns: string - page id

SipaOnsenPage.currentPageClass() SipaBasicView

Get current page class

SipaOnsenPage.currentLayoutId() string

Get layout id of current loaded layout

SipaOnsenPage.loadLayout(layout_id, options)

Load the given layout

ParamTypeDefaultDescription
layout_idstringto load
optionsObject
options.fade_effectbooleantruefade effect on layout change
options.keep_pagebooleanfalsekeep the loaded page, but change the layout only

SipaOnsenPage.callMethodOfPage(page_id, method_name, parameters)

Call the given method of the given page with given parameters (optional)

ParamType
page_idstring
method_namestring
parametersArray

SipaOnsenPage.callMethodOfLayout(layout_id, method_name, parameters)

Call the given method of the given layout with given parameters (optional)

ParamType
layout_idstring
method_namestring
parametersArray

SipaOnsenPage.setConfig(config)

Set the configuration of pages and layouts

ParamType
configObject
config.default_layoutstring
config.default_layoutsObject

Example

SipaOnsenPage.setConfig({
// default layout for all pages
default_layout: 'default',
// specific layouts for some pages { <page-name>: <layout-name> }
default_layouts: {
// overwrites the layout for the page 'login-page' with layout 'mini-dialog'
'login-page': 'mini-dialog'
}
});

SipaOnsenPage.popPage(options) Promise

Kind: static method of SipaOnsenPage

ParamTypeDescription
optionsObject
options.onsenOnsenOptionsoptions passed to original OnsenUI popPage

SipaOnsenPage.addStatusBarMock()

Add a status bar mock to the app

SipaOnsenPage.removeStatusBarMock()

Remove status bar mock of the app

SipaOnsenPage._initStatusBarMock()

Initialize status bar mock - do not run before first page is loaded!

SipaOnsenPage.reset()

Reset all states

Useful for unit testing

SipaOnsenPage.OnsenOptions : Object

Kind: static typedef of SipaOnsenPage

ParamTypeDescription
animation'slide' | 'lift' | 'fade' | 'none' | 'slide-ios' | 'lift-ios' | 'fade-ios' | 'slide-md' | 'lift-md' | 'fade-md'Animation name. Available animations are "slide", "lift", "fade" and "none". These are platform based animations. For fixed animations, add "-ios" or "-md" suffix to the animation name. E.g. "lift-ios", "lift-md". Defaults values are "slide-ios" and "fade-md".
animationOptionsObjectSpecify the animation’s duration, delay and timing. E.g. {duration: 0.2, delay: 0.4, timing: 'ease-in'}.
animationOptions.durationnumber
animationOptions.delaynumber
animationOptions.timingstring
callbackfunctionFunction that is called when the transition has ended.
dataObjectCustom data that will be stored in the new page element.
timesnumberNumber of pages to be popped. Only one animation will be shown. Works only on popPage
pagestringOnly necessary if no page is given.
pageHTMLstringHTML code that will be computed as a new page. Overwrites page parameter.

TypeOptionsType : Object

Custom type definitions for excellent IDE auto complete support Properties

NameType
prefixstring
file_extstring

SipaOnsenPageConfig : Object

Kind: global typedef

ParamType
default_layoutstring
default_layoutsObject