Hey Chris,

1) The container does load the rpc library.
2) Each gadget on the container is loaded from a URL that does contain
a rpc token in the fragment part.
3) I do not see the setRelayUrl and setAuthToken calls. Is this
something that should be automatically generated without my
intervention into shindig code or something that requires changing
shindig? As I understand, these calls should be placed on the
container not in each gadget?

In any case, does gadget-to-gadget communication go through the
container or directly between two iframes? If I interpret the code
correctly, the setRelayUrl and setAuthToken calls enable communication
between container and gadget, not between two gadgets - when
gadgets.rpc.call is invoked within a gadget and an ID which is not the
container is specified, the wpm transport fails when trying to obtain
the destination frame since window.frames[targetId] is undefined
(since the target is not a child of the gadget, rather it's sibling).

Thanks!
Ivan

On Fri, Oct 16, 2009 at 14:56, Chris Chabot <chab...@google.com> wrote:
> Just to make sure, does your container page (the social site containing the
> gadgets) have something like:
>
> <script type="text/javascript" src="
> http://shindig.example.org/gadgets/js/rpc.js?c=1";></script>
>
> And then for each gadget iframe on the page generate:
> <iframe
>  .. params..
>  src="http://example.org/gadgets/ifr?..params#rpctoken=12345";
>  name="remote_iframe_123"
>  id="remote_iframe_123">
> </iframe>
>
> <script type="text/javascript">
> gadgets.rpc.setRelayUrl("remote_iframe_123", "
> http://example.org/gadgets/ifr?..params#rpctoken=12345";);
> gadgets.rpc.setAuthToken("remote_iframe_123, "12345");
> </script>
>
> If not, that would be the reason for rpc's not getting through
>
> On Fri, Oct 16, 2009 at 1:03 AM, Ivan Žužak <izu...@gmail.com> wrote:
>
>> Hi all,
>>
>> I'm trying to establish direct communication between two gadgets
>> loaded on a container. On one gadget, I register a procedure using
>> gadgets.rpc.register, and on another gadget I invoke gadgets.rpc.call
>> passing the ID of the first gadget ("remote_iframe_0") and the
>> registered procedure name.
>>
>> However, the call seems to never leave the sender gadget as I'm
>> getting the "No relay set (used as window.postMessage targetOrigin),
>> cannot send cross-domain message" error from wpm.transport.js.
>>
>> This, and the "...gadget-to-gadget (thru container) communication..."
>> from the rpc.js header comment makes me wonder if this scenario is
>> actually possible (not considering workarounds using pub-sub or
>> gadget-container-gadget communication)? If not, can someone briefly
>> explain the reasoning behind not enabling this?
>>
>> Grateful for any feedback,
>> Ivan
>>
>

Reply via email to