Hi,
I am not sure if this is a bug or i don't know how to add an array as
a user preference .
But i'm unable to save the array permanently . I'm using setArray()
and getArray() .
Here is my code .
**********************************************************
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Some title......">
<Require feature="opensocial-0.7"/>
<Require feature="setprefs" />
</ModulePrefs>
<UserPref name="my_arr" datatype="list"/>
<Content type="html">
<![CDATA[
Hello!!
<script type="text/javascript">
var prefs = new gadgets.Prefs();
function init()
{
alert('hello!!');
}
function setArray()
{
alert('inside set');
alert(prefs);
prefs.setArray("my_arr" , ["a","b","c"] );
}
function getArray()
{
alert('get arr');var arrget = [] ;
arrget = prefs.getArray("my_arr");
alert(arrget);var j = 0 ;for( j = 0 ; j < 3 ; j++ )
{
alert( arrget[j] ) ; }
}
gadgets.util.registerOnLoadHandler(init);
</script>
<input type=button value="getArray" name="getarray"
onClick="getArray()">
<input type=button value="setArray" name="setarray"
onClick="setArray()">
]]>
</Content>
</Module>
**********************************************************
I can get the array after i set it , but the array does not get stored
in the app as a pref .
Does any one know where i'm wrong ?
-regards
-rav
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---