State callback function is called multiple times when there is more than one key-value pair in the delta object

0 views
Skip to first unread message

Vikram

unread,
Nov 7, 2009, 7:29:09 AM11/7/09
to Google Wave API
Hi fellow wave developers,

I have found that the when there are multiple key-value pairs in the
delta, the call to submitDelta method of state object triggers the
state change callback function as many times as the number of key
value pairs.

Why is this happening?

Am I missing something?

This how make call to the submitDelta method:

wave.getState().submitDelta({'Name':"Vikram",'color':"red"});

Is this fine? Or is there a mistake in this call?

Please help.

Thanks in advance.

Vikram Dhillon

unread,
Nov 9, 2009, 11:45:40 PM11/9/09
to google-...@googlegroups.com
You have a nice name :)

The method call seems to be fine, please elaborate on number of key value pairs, I think it makes sense that if you have more than 1 key pairs then it should make more than 1 object.

--
Regards,
Vikram Dhillon
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "Google Wave API" group.
> To post to this group, send email to google-...@googlegroups.com
> To unsubscribe from this group, send email to google-wave-a...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
signature.asc

Vikram

unread,
Nov 10, 2009, 12:08:02 AM11/10/09
to Google Wave API
Thanks for the reply Vikram :)

My doubt is when i supply multiple key-value pairs as a part of single
delta object, why is it the state callback function called as many
times as the number of key-value pairs. When the key-value pairs are a
part of the single delta object I feel that the state callback
function should be called only once.

Vikram Dhillon

unread,
Nov 10, 2009, 12:14:35 AM11/10/09
to google-...@googlegroups.com
I apologize for being a little vague here, can you give me a link to this function in the API, I might have to dig in a little more on this topic

--
Regards,
Vikram
signature.asc

Vikram

unread,
Nov 10, 2009, 1:28:59 AM11/10/09
to Google Wave API

Vikram Dhillon

unread,
Nov 10, 2009, 11:57:57 PM11/10/09
to google-...@googlegroups.com
Alright sorry for replying late, I looked at the API guide, and the callback constructor and the getkeys() method are both types of arrays, so I think that some where in your program you might have another variable processing parts of the array: it might go through some elements of the array whenever each element is being processed it calls the constructor to create a new key-value pairs. Thus are multiple key-value pairs. Please feel free to correct me if I am wrong.

--
Regards,
Vikram

On Tue, Nov 10, 2009 at 1:28 AM, Vikram <vikram....@gmail.com> wrote:
>
> Here is the documentation of all the APIs:
>
> http://code.google.com/apis/wave/extensions/gadgets/reference.html
signature.asc

Vikram Dhillon

unread,
Nov 10, 2009, 11:57:57 PM11/10/09
to google-...@googlegroups.com
Alright sorry for replying late, I looked at the API guide, and the callback constructor and the getkeys() method are both types of arrays, so I think that some where in your program you might have another variable processing parts of the array: it might go through some elements of the array whenever each element is being processed it calls the constructor to create a new key-value pairs. Thus are multiple key-value pairs. Please feel free to correct me if I am wrong.

--
Regards,
Vikram

On Tue, Nov 10, 2009 at 1:28 AM, Vikram <vikram....@gmail.com> wrote:
>
> Here is the documentation of all the APIs:
>
> http://code.google.com/apis/wave/extensions/gadgets/reference.html
signature.asc
Reply all
Reply to author
Forward
0 new messages