redirectToPrevious (XSPContext - JavaScript)

Opens the previous page in the navigation history, replacing the current page.

Defined in

XSPContext (JavaScript)

Syntax

redirectToPrevious() : void

Usage

This method retrieves the page with its last state. Other methods that open pages such as redirectToPage (XSPContext - JavaScript) do not restore state.

This method opens the home page of the application if there is no previous page.

Examples

This button opens the previous page if there is one in the history.
if(context.getHistoryUrl(-1) != null) {
	context.redirectToPrevious()
}