Fork me on GitHub


Download ZIP Download TAR View on GitHub

Launching Other TAL Applications

The framework can launch other TAL applications, preserving URL query parameters and maintaining a history stack.

To launch a new TAL application by URL, obtain a reference to the Application object, then call the function launchAppFromURL():

application.launchAppFromURL('http://www.example.com/talapp/');

It’s also possible to pass additional query parameters to the new application. Query parameters passed to the existing application will be preserved and passed to the new application by default. To overwrite them with your query parameters instead, pass True to launchAppFromURL() as the optional fourth parameter.

This example demonstrates how to relaunch the same application with an additional query parameter mode and a route in the new application:

application.launchAppFromURL(application.getCurrentAppURL(), {mode: 'test'}, ['main', 'favourites']);

History is automatically maintained and passed between TAL applications. For information on how to use it to navigate backwards, see the section on exiting.

Gain access to existing query parameters

Existing URL query parameters passed to the current application can be obtained as a JSON object by using getCurrentAppURLParameters(). For example:

var params = application.getCurrentAppURLParameters();
if (params.mode === 'test') {
    ...
}

Remember that by default, query parameters passed to launchAppFromURL() are merged with existing ones, so there’s no need to use getCurrentAppURLParameters() to do the merging explicitly.