OpenWGA 7.11 - TMLScript reference

WGA
Method :

redirectTo(String url)

On object WGA
Usage Redirects the users browser to a different URL
Description

This method should be used in a WebTML action as it is only effective if no content has yet been sent back to the browser. It then cancels the current request (the called WebTML page is neither rendered nor sent to the browser) and directly instructs the users browser to head to the given URL.

When used in an AJAX action this method will cancel the rendering of the portlet and trigger a reload of the complete webpage.

All other HTTP response or cookie settings that may have been set before in the request are ineffective if this operation is called.

For backward compatibility there still is a method "redirectTo()" available on TMLContext whose use is discouraged since OpenWGA 5.3.

Parameters url (String):

URL to which to redirect the users browser

Allowed in script types
  • WebTML pages and normal WebTML actions
Examples This method is mostly combined with URL generating functionalities of TMLScript, like method this.contentURL(). The following code redirects the browser to the document of the unique name "main":

WGA.redirectTo(context("name:main").contentURL())