Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

PegaE_onLoad events do not work correctly

SA-14537

Summary



When using an IAC gadget to create new work, PegaE_OnLoad method does not fire correctly.
 

Error Messages



Not Applicable
 

Steps to Reproduce



Apply the IAC Gadget code to create new work as below.

<div id="TestWithTimer"
style="overflow:auto"
PegaGadget="TestWithTimer"
PegaResize="stretch"
PegaA="createNewWork"
PegaA_className="<ClassName>"
PegaA_flowName="<FlowName>"
PegaA_model=""
PegaDefer="false"
PegaA_params={UserIdentifier:"<user>"}
PegaE_onLoad="onLoad1">
</div>

<script>
var timer;
var timeoutTime=60000;

function setRedirectToHomeTimer(){
timer = setTimeout("redirectToHome()", timeoutTime);
}
function resetTimeout(){
clearTimeout(timer);
setRedirectToHomeTimer();
}
function redirectToHome(){
window.location.href='index.html';
}
function onLoad1(){
alert("On onLoad1");
resetTimeout();
}
</script>


Root Cause



The sample HTML was loaded in to the browser from a file. Although the gadget content displays, this does not satisfy same domain origin policy. Therefore, the iFrame that contains the the PRPC content could not bubble up the method call to the top window level function due to Access Denied Javascript errors.

Resolution

When testing IAC gadgets with advanced usage, use a Web Server to host the gadget code and configure the Web Server to satisfy same domain origin policy with the PRPC URL. 

Suggest Edit

Published October 1, 2015 - Updated October 8, 2020

Did you find this content helpful? Yes No

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us