Thanks, this helped alot. The problem is how you are rendering the gadget, you are doing more work than you have to :) For this simple sample there is no need to preload the gadget. So you can removed the addGadgetHandler function and replace addGadget with this code. function addGadget() { var parent = window.location.origin; var el = document.getElementById("gadgetContainer"); var site = container.newGadgetSite(el) var params = {}; params[osapi.container.RenderParam.WIDTH] = '100%'; container.navigateGadget(site, gadgetUrl, {}, params); console.log("inside add gadget handler"); } Calling navigateGadget helps to setup the rpc functionality. I tested this in FF and Chrome and it seems to work. Hope this helps! On Thu, Feb 13, 2014 at 10:41 AM, Wade Girard wrote: > Okay, sorry for the delay, took me a little time to put this together > > Here is the container html > > > > > > > > > >
> >
>
> > > > > I am using version 2.5 update 1 > -- > Wade Girard | Principal Software Engineer > > Calabrio, Inc. | 400 1st Avenue N, Ste 300 | Minneapolis, MN 55401 > Phone: 763.795.7798 > > > > > On 2/12/14, 3:24 PM, "Ryan Baxter" wrote: > >>Wade can you provide a sample container html file so I can try it >>locally? What version of Shindig are you using? >> >>On Wed, Feb 12, 2014 at 3:50 PM, Wade Girard >>wrote: >>> Hi Ryan, >>> Thank you for your suggestions. I changed the gadget to this >>> >>> >>> >>> >>> >>> >>> >> >>>
Hello World
>>> ]]> >>>
>>>
>>> >>> >>> And Removed the code that did the gadgets.rpc.register and >>> gadgets.rpc.setupReceiver and added the code to the container. Here is >>> what it looks like (added the full config, in case I am missing >>>something >>> there) >>> >>> var testConfig = {}; >>> >>>testConfig[osapi.container.ServiceConfig.API_PATH] = >>> 'http://localhost/rpc'; >>> >>>testConfig[osapi.container.ContainerConfig.RENDER_DEBUG] = '1'; >>> >>>testConfig[osapi.container.ContainerConfig.GET_CONTAINER_TOKEN] = >>> function(callback) { >>> gadgets.log('Updating container >>>security token.'); >>> >>>callback('john.doe:john.doe:appid:cont:url:0:default', 10); >>> }; >>> this._container = new osapi.container.Container(testConfig); >>> >>>this._container.rpcRegister("initial_gadget_message", >>> _setTitleHandler)); >>> >>> >>> >>> Unfortunately I am still getting the same message in the firebug console >>> No relay set (used as window.postMessage targetOrigin), cannot send >>> cross-domain message >>> >>> >>> Thanks for all your help. >>> -- >>> Wade Girard | Principal Software Engineer >>> >>> Calabrio, Inc. | 400 1st Avenue N, Ste 300 | Minneapolis, MN 55401 >>> Phone: 763.795.7798 >>> >>> >>> >>> >>> On 2/12/14, 2:31 PM, "Ryan Baxter" wrote: >>> >>>>Hi Wade, >>>> >>>>A couple of comments. >>>> >>>>1.) In your gadget you probably want to wrap gadgets.rpc.call in a >>>>function passed to gadgets.util.registerOnLoadHandler to make sure the >>>>gadget is completely initialized before making that rpc call. >>>>2.) In your container I would suggest you use the container feature. >>>>It takes care of some of the nasty stuff with regards to registering >>>>RPC callback functions. All you then have to do is call >>>>container.rpcRegister('initial_gadget_message', _messageHandler) >>>> >>>>On Wed, Feb 12, 2014 at 2:16 PM, Wade Girard >>>>wrote: >>>>> I am trying to implement a container running under Shindig. >>>>> >>>>> I am having difficulty getting the rpc (Gadget->Contianer) >>>>>communication working. >>>>> >>>>> Here is my simple gadget: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>>> >>>>> >>>>>
Hello World
>>>>> >>>>> ]]> >>>>> >>>>>
>>>>> >>>>>
>>>>> >>>>> Here is what I have done on the server (adapted) >>>>> >>>>> var id = "gadget_" + (this._static.id++); >>>>> >>>>> gadgets.rpc.register("initial_gadget_message", _messageHandler)); >>>>> >>>>> var parent = window.location.origin; // also tried >>>>>window.location.href >>>>> >>>>> iFrameNode.src = obj.iFrameUrls["default"] + "#parent=" parent + >>>>>"&rpctoken=12345"; >>>>> >>>>> iFrameNode.id = id; >>>>> >>>>> gadgets.rpc.setupReceiver(id); >>>>> >>>>> The container is at port 80, the gadget is at port 8080, on the same >>>>>server (localhost) >>>>> The gadget loads in the container, but most of the time produces this >>>>>message, sometimes, vary rarely, it will not produce the message. >>>>> >>>>> No relay set (used as window.postMessage targetOrigin), cannot send >>>>>cross-domain message >>>>> >>>>> Any help is appreciated, thanks >>>>> -- >>>>> Wade Girard | Principal Software Engineer >>>>> Calabrio, Inc. | 400 1st Avenue N, Ste 300 | Minneapolis, MN 55401 >>>>> Phone: 763.795.7798 >>> >