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

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");

Error Messages

No script errors, function never returns data.

Steps to Reproduce

Using "getGadgetData" in IAC mash up page.

Root Cause

The problem was with this Javascript used:

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:

After following the Gadget Manager Reference PDN article, user must modify the Javascript to resolves the issue. 

Following is the modification for the Javascript:

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:

function pegaOnConfirm(gadgetName){
   var pOp = pega.web.api.doAction(gadgetName, "getGadgetData", ".pxCreateOpName");

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

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.

Did you find this content helpful?

Want to help us improve this content?

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