Support Article
getGadgetData operation not working in doAction in Web Mashup
SA-19963
Summary
getGadgetData operation not working in doAction in Web Mashup
User has widget successfully running using Pega Web Mashup and it launches from the calling application.
User has added a Data Field and now trying to access the property in that Data Field using doAction but it is returning undefined in JS alert.
Below is the code used:
function GetSelectedCaseIds()
{
var SelectedCaseIds = pega.web.api.doAction("MyTestGadget", "getGadgetData", ".SelectedCaseIds");
alert("Test data " + SelectedCaseIds);
}
Error Messages
alert Java script function is throwing "undefined" error
Steps to Reproduce
- Setup the widget.
- Add Data Field to the section and set the property.
- Add the doAction function.
Root Cause
Same Domain Origin Policy was not satisfied when testing. The purpose of getGadgetData is to get content from the PRPC display area for use in the main top level application. With out Same Domain Origin Policy met the outer application can not communicate with the PRPC generated iframe.
Resolution
Always test mashup functionality in an environment that satisfies Same Domain Origin Policy.
Published February 18, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.