Review Board 1.7.22


rpc does not support communicating with gadget created on an dom node in existing iframe

Review Request #3908 - Created Feb. 15, 2012 and updated

Yao Zhang
SHINDIG-1704
Reviewers
shindig
ddumont, hsaputra, lixu, ssievers
shindig
When you try to render a gadget to a dom node inside an existing iframe, rpc does not work as the code is using document.getElementById to get the domnode

 
http://svn.apache.org/repos/asf/shindig/trunk/extras/src/main/javascript/features-extras/org.openajax.hub-2.0.5/iframe.js
Diff Revision 1 Diff Revision 3
[20] 404 lines
[+20] [+] function createIframe() {
405
        var embeddedlevel = 0;
405
        var embeddedlevel = 0;
406
        while (p && p !== window) {
406
        while (p && p !== window) {
407
        	p = p.parent;
407
        	p = p.parent;
408
        	embeddedlevel++;
408
        	embeddedlevel++;
409
        }
409
        }
410
        iframe.src = params.IframeContainer.uri + "#embeddedlevel="+ embeddedlevel +
410
        iframe.src = params.IframeContainer.uri + 
411
                "#rpctoken=" + securityToken + tunnelText + idText;
411
                "#rpctoken=" + securityToken + tunnelText + idText +"&embeddedlevel="+ embeddedlevel;
412
    }
412
    }
413

    
   
413

   
414
    // If the relay iframe used by RPC has not been loaded yet, then we won't have unload protection
414
    // If the relay iframe used by RPC has not been loaded yet, then we won't have unload protection
415
    // at this point.  Since we can't detect when the relay iframe has loaded, we use a two stage
415
    // at this point.  Since we can't detect when the relay iframe has loaded, we use a two stage
416
    // connection process.  First, the child sends a connection msg and the container sends an ack.
416
    // connection process.  First, the child sends a connection msg and the container sends an ack.
[+20] [20] 477 lines
http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js
Diff Revision 1 Diff Revision 3
 
http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js
Diff Revision 1 Diff Revision 3
 
  1. http://svn.apache.org/repos/asf/shindig/trunk/extras/src/main/javascript/features-extras/org.openajax.hub-2.0.5/iframe.js: Loading...
  2. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/container.site.gadget/gadget_holder.js: Loading...
  3. http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/rpc/rpc.js: Loading...