Using the AppCache.Load method to run applications

Applications are normally started when a user selects a tile in the Neptune launchpad. Applications can also be started in a range of other scenarios, for example, an application can be started just by running the direct URL.

If you only need to run one application, Neptune recommends running the application inside the Neptune launchpad. You can set the launchpad to only run this one application. By doing this, you still get the benefit of the launchpad framework.

Another way to start an application is by code using the AppCache.Load method. By doing this in the Neptune launchpad, you can take advantage of all the launchpad events. You can also run applications inside another application in a parent frame, making your Neptune applications reusable in a wide range of scenarios.

When an application is started using AppCache.Load, the onInit, and onBeforeDisplay event handlers are called, though not in the same way in all the different loading scenarios.

The following matrix provides an overview of the different loading scenarios to consider when using the AppCache.Load method.

Scenario

Code

First call

Subsequent calls

Selecting navigation item

From tile selection

onInit,
onbeforeDisplay

onbeforeDisplay

onbeforeDisplay

Standalone without onInit

AppCache.Load("APP");

onInit,
onbeforeDisplay

onbeforeDisplay

Standalone with onInit,
first call

AppCache.Load("APP", \{
    load: "init"
});

onInit

Standalone with onInit  
subsequent calls

AppCache.Load("APP");

onbeforeDisplay

onbeforeDisplay

In parent

AppCache.Load("APP", \{
    parentObject: panel
});

onInit,
onbeforeDisplay

onbeforeDisplay

With navigation item

AppCache.Load("APP", \{
    load: "nav"
});

onInit,
onbeforeDisplay

onbeforeDisplay

In dialog

AppCache.Load("APP", \{
    dialogShow: true
});

onInit,
onbeforeDisplay

Single app in launchpad

onInit,
onbeforeDisplay

App in tile group

onInit,
onbeforeDisplay

App in tile

onInit,
onbeforeDisplay

AppCache.Load method loading scenario examples

The following examples display code snippets of various AppCache.Load method loading scenarios alongside the effects that occur on the user interface when run.

Standalone without onInit scenario

Code in App Designer:

AppCache.Load("appcache_loaded_app");

User interface of application on runtime:

Standalone without onInit scenario: When the button is pressed
Standalone without onInit scenario: Child app is loaded on top of the parent app

Standalone with onInit scenario

Code in App Designer:

AppCache.Load("appcache_loaded_app", {
    load: "init",
});

User interface of application on runtime:

Standalone with onInit scenario: The app file loads to the device database
Standalone with onInit scenario: The apps are initialized

In parent scenario

Code in App Designer:

AppCache.Load("appcache_loaded_app", {
    parentObject: inParent,
});

User interface of application on runtime:

In parent scenario: When button is pressed
In parent scenario: Child app is loaded and embedded within the parent’s app "IconTabFilter" component

With navigation item scenario

Code in App Designer:

AppCache.Load("appcache_loaded_app", {
    load: "nav",
    navTitle: "AppCache.Load Nav Title",
    navIconSrc: "sap-icon://blur"
});

User interface of application on runtime:

With navigation item scenario: When button is pressed
With navigation item scenario: The child app is loaded and opened in a new tab on the launchpad through a new nav item

In dialog scenario

Code in App Designer:

AppCache.Load("appcache_loaded_app", {
    dialogShow: true
});

User interface of application on runtime:

In dialog scenario: When the button is pressed
In dialog scenario: Child app is loaded in a dialog on top of the parent app