On Mon, May 11, 2009 at 4:46 PM, Jordan Zimmerman <[email protected]> wrote:
> >Both gadget to container and container to gadget communications are
> >possible in an async channel, but you don't really need that. The
> >parent page can (and should) respond asynchronously to RPC calls:
>
> I can't get this to work. In my container I have:
>
> gadgets.rpc.register
> (
> "requestSendMessage",
> function(recipients, message, opt_callback, opt_params)
> {
> // do some stuff
> var functionResult = ...
> if ( this.callback )
> {
> this.callback(functionResult);
> }
> }
> );
>
> RPC relay is registered in both container and gadget. I tried various
> things in the gadget including calling:
>
> gadgets.rpc.register(gadgets.rpc.CALLBACK_NAME, _my_handler);
>
> What do I need to do in the gadget to get the callback to resolve?
What you're doing looks correct to me. Are you getting any errors when you
invoke the callback? What browser are you using?
>
>
> Jordan Zimmerman
> Principal Software Architect
> 831.647.4712
> 831.214.2990 (cell)
> [email protected]
>
> SHOP*COMTM
> Shop Smart, Save Big(tm)
> www.shop.com
>
> This message (including any attachments) is intended only for
> the use of the individual or entity to which it is addressed and
> may contain information that is non-public, proprietary,
> privileged, confidential, and exempt from disclosure under
> applicable law or may constitute as attorney work product.
> If you are not the intended recipient, you are hereby notified
> that any use, dissemination, distribution, or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, notify us immediately by telephone and
> (i) destroy this message if a facsimile or (ii) delete this
> message
> immediately if this is an electronic communication.
>
> Thank you.
>