5 messages in com.googlegroups.google-desktop-developerRe: options.putValue() problem
FromSent OnAttachments
pop27 Mar 2008 22:17 
Teo27 Mar 2008 22:30 
pop27 Mar 2008 23:19 
Teo27 Mar 2008 23:29 
pop28 Mar 2008 07:18 
Subject:Re: options.putValue() problem
From:pop (pop.@gmail.com)
Date:03/27/2008 11:19:43 PM
List:com.googlegroups.google-desktop-developer

Can GD use JSON on the backend to persist complex objects?

Thanks

Pop

On Mar 28, 1:30 am, Teo <teom@gmail.com> wrote:

Hi,

usually we use JSON to remember complex objects:http://www.json.org/

Here's more info (including actual .js files that you can include) on how to use JSON with Javascript:http://www.json.org/js.html

Thanks, Teo

On Fri, Mar 28, 2008 at 7:18 AM, pop <pop.@gmail.com> wrote:

Hi everyone-

I am trying to put a composite javascript object into options.

for example:

var g_myStuff={ "one":1, "two":"two" };

Then when in main.js function launchOptionsDialog(){ options.putValue("myStuff",g_myStuff); ... }

and in options.js function onOpen(){ var myStuff = options.getValue("myStuff"); ... }

Everything was okay but when the Options Dialog is closed (and deploy this gadget to sidebar), an exception is thrown and says "Data can not be saved...."

Conclusion: GD can not persist composite javascript objects via options.putValue()

Is it a feature (lack of object reflection?) or a bug?

Thanks, Pop