Re: T5: JSONArray + fillling

2008-05-15 Thread Sven Homburg
http://www.prototypejs.org/learn/json 2008/5/15 Leon Derks <[EMAIL PROTECTED]>: > Thanks, > > How can I loop through the jsonObjects in javascript? > > I have now something like this: > > array.each(function(item) { > item[0] item[1] > //fill options with the item. > } > > But I get undefined

Re: T5: JSONArray + fillling

2008-05-15 Thread Leon Derks
Thanks, How can I loop through the jsonObjects in javascript? I have now something like this: array.each(function(item) { item[0] item[1] //fill options with the item. } But I get undefined text in for my select option values. The number of items in my select is correct, but the key-value i

Re: T5: JSONArray + fillling

2008-05-14 Thread Lance Java
JSONArray options = new JSONArray(); for(Group group : List groups) { JSONObject obj = new JSONObject(); obj.put(group.getId, group.getName()); options.put(obj); } Cheers, Lance. 2008/5/14 Leon Derks <[EMAIL PROTECTED]>: > Can you give me an example of that? > > Leon > > > Lance Java wr

Re: T5: JSONArray + fillling

2008-05-14 Thread Leon Derks
Can you give me an example of that? Leon Lance Java wrote: You want a JSONObject not a JSONArray http://tapestry.formos.com/nightly/tapestry5/apidocs/index.html Cheers, Lance. 2008/5/14 Leon Derks <[EMAIL PROTECTED]>: Hello I found this example: new JSONArray("[['a', 'value a'], ['b',

Re: T5: JSONArray + fillling

2008-05-14 Thread Lance Java
You want a JSONObject not a JSONArray http://tapestry.formos.com/nightly/tapestry5/apidocs/index.html Cheers, Lance. 2008/5/14 Leon Derks <[EMAIL PROTECTED]>: > Hello > > I found this example: > > new JSONArray("[['a', 'value a'], ['b', 'value b'], ['c', 'value c'], ['d', > 'value d']]")); > > T

T5: JSONArray + fillling

2008-05-14 Thread Leon Derks
Hello I found this example: new JSONArray("[['a', 'value a'], ['b', 'value b'], ['c', 'value c'], ['d', 'value d']]")); The JSONArray contains information for my select box, with a value - label pair. But in my case, I want to make a new JSONArray filled with properties from my List of Gr