I'm not exactly sure if I understand your problem correctly. Basically
you need two callbacks.
One you set up with gadgets.util.registerOnLoadHandler(waveInit); at
this point you probably can't even use any of the wave functionality,
you don't even have any of your HTML code rendered. Google makes a
call to waveInit when the Gadget and Wave is ready. So you now enter
waveInit. At this point, your gadget has been drawn.
In waveInit you now get to check if Wave is doing ok, and you can set
up your second callback. This second callback you can only set up when
Wave is up and running, that's why you make sure that wave exists.
if (wave && wave.isInWaveContainer()) {
wave.setStateCallback(waveStateUpdated);
wave.setParticipantCallback(waveParticipantUpdated);
This waveInit is basically what the jquery onload handler does. but
the difference is that, since jquery can't look into internal
'readyness' state of the wave object, you shouldn't use it. you can
use it, but you are not guaranteed that you can use wave. so you
should want to use gadgets.util.registerOnLoadHandler, because they
know when it's ready.
Even if your inside waveInit, wave is only partially avaliable. At
this time you can only set up the callbacks. This is when you say, 'if
you've got state data to give to me, give it to me to the function
which I set up with wave.setStateCallback(waveStateUpdated);
So then, when Google knows that you're ready to receive data, that is,
when you told it that you've got your waveStateUpdated function, then
it will call the function with all the data avaliable in the wave
object. This most probably won't happen before you exit waveInit. So
use waveInit only to set up wave, and to do some js ui-modifications
which don't depend on the state of wave.
On Nov 18, 2:38 am, "pamela (Google Employee)" <[email protected]>
wrote:
> The "wave-preview" library (served from wave-api.appspot.com) was down for
> approximately 30 minutes this morning, and OpenSocial templates were broken
> for about 3 hours. These were separate but somewhat related issues. We're
> looking into tests that will prevent these from happening in the future.
>
> - pamela
>
> On Tue, Nov 17, 2009 at 10:47 AM, Justin <[email protected]> wrote:
> > Anyone else finding their gadgets not working right now?
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Google Wave API" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-wave-api%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-wave-api?hl=.
--
You received this message because you are subscribed to the Google Groups
"Google Wave API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-wave-api?hl=.