IAC getGadgetData does not work in Pega 7.1.7
Within a PegaE event user is not getting any data back when using getGadgetData:
var pOp = pega.web.api.doAction(IACGaget, "getGadgetData", ".pxCreateOpName");
No script errors, function never returns data.
Steps to Reproduce
Using "getGadgetData" in IAC mash up page.
var pOp = pega.web.api.doAction(IACGadget, "getGadgetData", ".pxCreateOpName");
The first parameter to the pega.web.api.doAction should be a string reference to a DIV element that has the same value in the PegaGadget attribute. The value passed above was actually the DOM reference to the DIV because it had an ID of IACGadget. This caused errors within the doAction method.
Refer to PDN article for the Gadget Manager Reference:
var pOp = pega.web.api.doAction("IACGadget", "getGadgetData", ".pxCreateOpName");
Adding the double quotes turned the parameter into a string and the doAction method worked properly.
The gadget name is also the first parameter sent into any PegaE event so the code could also be written like:
var pOp = pega.web.api.doAction(gadgetName, "getGadgetData", ".pxCreateOpName");
0% found this useful