Hi everybody. I have a script like this:

  /////////////////////////////////////////////////////////////////
// get text value typed from a form
 var destination = document.getElementById('input_destino').value;
// display loading message
  document.getElementById('block01').innerHTML = "Loading ...";
  var dia = timestamp;

/* prepare an array to be save do persistent data. The array index
will be a timestamp value loaded from an external server (php file).
The value is the typed text (var destino) */

  salvarDestino[dia] = destino;
  var json = gadgets.json.stringify(salvarDestino);

//* make the request for saving */
  var req = opensocial.newDataRequest();
 
req.add(req.newUpdatePersonAppDataRequest(opensocial.DataRequest.PersonId.VIEWER,
'ownerDestino', json));
  req.send(request);
  /////////////////////////////////////////////////////////////////

As you can see, I save an array with the name "ownerDestino".
Everytime the user clicks an "ok" button, it will save this array,
with a different timestamp as an index. So, the container should
always erase any previous value, and save this array with only one
timestamp index with 1 value, no matter what index, right?

However, when i fetch this information and loop the returned array, it
always shows previous values, without erasing them. Can you help me?

I have already tried to change the last part of the code, but anyway
it still shows the previous values:
//* make the request for saving */
  var req = opensocial.newDataRequest();
 
req.add(req.newUpdatePersonAppDataRequest(opensocial.DataRequest.PersonId.VIEWER,
'ownerDestino', null));
 
req.add(req.newUpdatePersonAppDataRequest(opensocial.DataRequest.PersonId.VIEWER,
'ownerDestino', json));
  req.send(request);

so i tried, in the same request, setting 'ownerDestino' to null, and
then saving, but won't work

any ideas?

thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial Application Development" 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/opensocial-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to