Table of Contents

Cannot load the same mashup again based on conditions


Only available versions of this content are shown in the dropdown

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().

    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>
Did you find this content helpful?

Have a question? Get answers now.

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