PageModule

The interface implemented by page modules. The file is referenced using the "Page module" property of a page. See Referencing module JavaScript for details. Each page can have 0 or 1 page modules. The page module instance can be accessed using the pageModuleInstance member of a page.

For an explanation of when events are called, see Order of events.

Example

Sample PageModule.js

define( function() {

    class PageModule
    {
        load( oPage )
        {

        }
        show( oPage )
        {

        }
        hide( oPage )
        {

        }
        destroy( oPage )
        {

        }
    }

    return PageModule;
    
});

Methods

destroy(oPage)

Called when the page is being destroyed. This method is optional.

Parameters:
NameTypeDescription
oPagePage

The page.

hide(oPage)

Called when the page is being hidden. This method is optional.

Parameters:
NameTypeDescription
oPagePage

The page.

load(oPage)

Called when the page is loaded. This can be used to set any required custom prompt validators. This method is optional.

Parameters:
NameTypeDescription
oPagePage

The page.

Example

Set a custom validator callback function

load( oPage )
{
	oPage.getControlByName( "txtZipCode" ).setValidator( fnZipCodeValidator );
}

show(oPage)

Called when the page is being shown/displayed. This method is optional.

Parameters:
NameTypeDescription
oPagePage

The page.