Hi, I'm new to both widget making and opensocial and I used the
Persistence API tro write a key and just to make sure it was there, I
tried to retrieve it but it always fails...
I'll paste the code below, hope that's ok, it just always goes into
the "if (response.get("get_data").hadError())" condition into the
failure alert.
If anyone could point me in the right direction here, I would greatly
appretiate it!
Thanks in advance.
-----------------------------------------
test();
function test(){
var req = opensocial.newDataRequest();
req.add(req.newUpdatePersonAppDataRequest("VIEWER", "registeredFlag",
"true"),"set_data");
req.send(set_callback);
}
function set_callback(response) {
if (response.get("set_data").hadError()) {
} else {
checkFlag();
}
}
function checkFlag(){
var idspec = opensocial.newIdSpec({ "userId" : "VIEWER", "groupId" :
"SELF" });
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonAppDataRequest(idspec, "registeredFlag"),
"get_data");
req.send(get_callback);
}
function get_callback(response) {
if (response.get("get_data").hadError()) {
alert("failure");
} else {
var data = response.get("get_data").getData();
alert("success!");
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Orkut Developer Forum" 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-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---