Skip to main content


Cannot load a mashup asynchronously based on an event or a flag

Suggest edit Updated on December 1, 2021
Applicable to Theme Cosmos applications

Ensure that you can successfully load a mashup asynchronously based on an event or a flag.


The mashup does not load when you try to load the mashup asynchronously based on an event, or depending on a flag.


  1. Put a debugger in the _initAllPegaObjects method defined in PegaCompositeGadgetMgr.js.
  2. If the debugger does not pause, you can explicitly invoke the method when you insert the mashup <div> snippet into the HTML. Use the following _initAllPegaObjects method definition:
    function _initAllPegaObjects() {
          if(pega && pega.web && pega.web.isWebMashup){
            if (!bPegaIacInitialOnLoad) {
            bPegaIacInitialOnLoad = false;
            pega.web.mgr._logMsg("info", "", "Manager", "Started Pega IAC manager initialization.");
            /*BUG-270078 Logic to detect cookie enabled or not*/
            pega.web.mgr._ut._setCookie("PegaIAC", "IACtest", 1);
            if (pega.web.mgr._ut._readCookie("PegaIAC") != "IACtest") {
              pega.web.mgr.cookiesDisabled = true;                                                                     // cookies are disabled
              pega.web.mgr._logMsg("error", "", "Manager", "error: Browser cookies must be enabled for Pega IAC to function.");
            pega.ctx.bEncryptURLs = false;
            bPegaIacGadgetsInitialized = true;
    <script src =''></script>
    For example: The following sample code inserts the mashup <div> snippet into the host page dynamically and explicitly invokes the _initAllPegaObjects method to initialize the mashup gadgets:
    function loadMashup() {
        var snippetDiv = document.createElement("div");
        snippetDiv.setAttribute("data-pega-gadgetname", "PegaGadget");
        snippetDiv.setAttribute("data-pega-action", "createNewWork");
        snippetDiv.setAttribute("data-pega-action-param-classname", "OES023-Myapplication-Work-Interaction");
        snippetDiv.setAttribute("data-pega-action-param-flowname", "pyStartCase");
        snippetDiv.setAttribute("data-pega-isdeferloaded", "false");
        snippetDiv.setAttribute("data-pega-threadname", "MashupThread");
        snippetDiv.setAttribute("data-pega-applicationname", "Myapplication");
        snippetDiv.setAttribute("data-pega-resizetype", "stretch");
        snippetDiv.setAttribute("data-pega-url", "");
        snippetDiv.setAttribute("data-pega-action-param-parameters", JSON.stringify({
             "UserIndentifier": "cherj",
             "Password": "xykdhjd"
         }) + "");
        //trigger mashup loading explicitly in asyn case
    <div id="wrapperDiv"></div>
    <button onclick="loadMashup">Load Mashup</button>
Did you find this content helpful? YesNo

Have a question? Get answers now.

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

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us