Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

Cannot load the same mashup again based on conditions

Updated on December 13, 2022
Applicable to Theme Cosmos applications

Learn more about the possible issues and their resolution to ensure that you can load the same mashup again based on certain conditions.


The mashup does not load when you load the same mashup again based on certain conditions.


When the postMessage handler registration on the host fails, you cannot load the same mashup again based on certain conditions. The postMessage handler registration must be successful to allow resizing and communication between the host page and gadget.


  1. Put a debugger in the HostActionProcessor or GadgetActionProcessor . If the debugger does not stop, then invoke pega.Mashup.Communicator.register (pega.Mashup.hostActionsProcessor) and _initAllPegaObjects() when the mashup script is loaded for the first time.
  2. For subsequent new mashup <div> snippets that you add, invoke _initAllPegaObjects().
    For example: See the following code sample:
    pega.Mashup.hostActionsProcessor = function(notifiedData){
      var gadgetIfrName = notifiedData.src,
          actionInfo = notifiedData.payload,gadgetId,gadget;
      gadgetId = gadgetIfrName;
      if(gadgetIfrName && gadgetIfrName.match(/Ifr$/)){
        gadgetId = gadgetIfrName.substring(0, gadgetIfrName.length-3);
      gadget = pega.web.mgr._getGadgetByID(gadgetId);
      switch( {
        case "loaded":
          if(pega.web.isWebMashup && gadget._oFrame) {
            //resetting height for initial mashup load , removing skeleton height
            if(gadget._bMaxIframeSize && == "400px"){
     = "";
            //"hostActionsProcessor: loaded");
            pega.Mashup.Communicator.send({name: "registerResize"}, {
              target: gadgetIfrName
          //"hostActionsProcessor: registerResize");
          gadget._oDiv.pyStreamName = actionInfo.pyStreamName;
        case "resizeMashup":
          var height = actionInfo.height;
    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": "xyzdkjmv"
         }) + "");
         if (pega && pega.Mashup) {
             //if mashup script already loaded
         } else {
             // load mashup scripts on-demand
             var mashupScriptElement = document.createElement("script");
             mashupScriptElement.onload = function () {
                 // 1. register post message communicator
                 // 2. trigger mashup loading explicitly for asyn case
             mashupScriptElement.src = "";
    <div id="wrapperDiv"></div>
    <button onclick="loadMashup">Load Mashup</button>
  • Previous topic Cannot load mashup due to SECU0019 exception
  • Next topic Cannot load a mashup asynchronously based on an event or a flag

Have a question? Get answers now.

Visit the Support 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. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us