redirectToPage (XSPContext - JavaScript)

Opens another page replacing the current page.

Defined in

XSPContext (JavaScript)

Syntax

redirectToPage(page:string) : void

redirectToPage(page:string, redirect:boolean) : void

Parameters Description
page The name of the new page. The file extension .xsp is optional.
redirect true (default) to send a redirect notification message to the client (HTTP 302); false to perform the redirect on the server.

Examples

(1) This button opens the page named page2. If that page has an edit box bound to a session-level scoped variable named param1, Hello world! appears there.
sessionScope.param1 = "Hello world!";
context.redirectToPage("page2", true);

(2) This button is the same but does the redirect on the server and uses the .xsp extension in the name.

sessionScope.param1 = "Hello world!";
context.redirectToPage("page2.xsp", false);