Skip to content

Instantly share code, notes, and snippets.

@bokks
Created June 23, 2020 18:02
Show Gist options
  • Save bokks/0116c318bc216a2472c94d3dff356ae8 to your computer and use it in GitHub Desktop.
Save bokks/0116c318bc216a2472c94d3dff356ae8 to your computer and use it in GitHub Desktop.
This is pattern for RedirectAndRun
/* In case of RedirectAndRun where the Location parameter is also a URL */
/* Both of them need to be encrypted */
switchMyApps:function(accessGroup) {
if (accessGroup == null) {
return;
}
var topWinTmp;
var oShowDesktopUrl;
if (pega.ui.composer) {
topWinTmp = pega.ui.composer.getCurrentComposerWindow();
oShowDesktopUrl = topWinTmp.SafeURL_createFromURL(pega.d.encryptedAppSwitch);
} else {
topWinTmp = top;
oShowDesktopUrl = SafeURL_createFromURL(pega.d.encryptedAppSwitch);
}
oShowDesktopUrl.put("AccessGroupName", accessGroup);
oShowDesktopUrl.put("Location",pega.d.encryptedAppSwitchLocation);
topWinTmp.location.href = oShowDesktopUrl.toURL();
}
/* This is a js file so Java/JSP cannot be written. Developer should take care of initializing the pega.d.encryptedAppSwitch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment