As I understood your problem correctly you want to have an Array in JSON and retrieve that array on the client side. If you are using GWT's JSON methods, they provide JSONArray class. So when you parse the object and call 'isArray()' function it returns an array that can have variable size of elements into it. In this array each element can be of any type so that you can have mix of multiple things like string as title and then intetger showing the length of that title etc.
- Avadh On Fri, Nov 14, 2008 at 11:24 AM, Brian H. Mayo <[EMAIL PROTECTED]>wrote: > > I am building a small application that deals with Compact Discs (CDs). > There is a grid that gets and displays a few pieces of CD information: > id, title, artist. > When a user clicks on a row, a form will populate with the details of > the CD for the user to edit and submit back. > The data comes from a JSON feed created in PHP. > > The rub here is that a CD (an album) can have a variable number of > tracks. Thus, the JSON coming back will have fixed fields like title, > artist, year, etc. but will also have a field called tracks that will > contain a variable number of string values. > > How can I code the form and feed retrieval so that when a user clicks > a row I can make the JSON request and populate a structure with the > assumption that I will have a tracks object that contains a variable > number of strings? My (little) experience hows that I must define the > record definition ahead of time before pulling the data from the feed > and while I see a StringRecordDef type and an IntegerRecordDef type, I > see nothing that allows for an array of values. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "GWT-Ext 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/gwt-ext?hl=en -~----------~----~----~----~------~----~------~--~---
