catalin.ciobanu
23 Sep 2011, 2:01 AM
Hi guys, I use JSON to load data and I can do it but without 1 element of it.
{"docodel":[{
"nome":"ssss",
"note":"no_note",
"oggetto":"Object_dwfa",
"properties":{
"numero":"Number_sssda"
},
"uuid":"1fd1cf79-8709-48be-b759-b53829c1b86c"
},
{
"nome":"ssss",
"note":"some note",
"oggetto":"Ca1Obj",
"properties":{
"numero":"CinNumber"
},
"uuid":"757c0a49-95e5-4656-99f8-99c17976132a"
},
{
"nome":"Cat23",
"note":"som211",
"oggetto":"CObjOsk",
"properties":{
"numero":"NumeroAlto"
},
"uuid":"aec5895e-3f65-4b4a-9f99-5216d0a7c082"
}]
}
Using this modeltype I manage to take all the data but the "properties" I cannot take.
ModelType type = new ModelType();
type.setRecordName(null);
type.setRoot("docodel");
type.addField("nome", "nome");
type.addField("note", "note");
type.addField("oggetto", "oggetto");
type.addField("properties", "properties");
type.addField("uuid", "uuid");
MemoryProxy<ModelData> proxy = new MemoryProxy<ModelData>(jsonData);
JsonReader<List<ModelData>> reader = new JsonReader<List<ModelData>>(
type);
loader = new BaseListLoader<ListLoadResult<ModelData>>(proxy, reader);
ListStore<ModelData> store = new ListStore<ModelData>(loader);
loader.load();
How can I access that specific member which is a JSON Object ? Thanks a lot !
{"docodel":[{
"nome":"ssss",
"note":"no_note",
"oggetto":"Object_dwfa",
"properties":{
"numero":"Number_sssda"
},
"uuid":"1fd1cf79-8709-48be-b759-b53829c1b86c"
},
{
"nome":"ssss",
"note":"some note",
"oggetto":"Ca1Obj",
"properties":{
"numero":"CinNumber"
},
"uuid":"757c0a49-95e5-4656-99f8-99c17976132a"
},
{
"nome":"Cat23",
"note":"som211",
"oggetto":"CObjOsk",
"properties":{
"numero":"NumeroAlto"
},
"uuid":"aec5895e-3f65-4b4a-9f99-5216d0a7c082"
}]
}
Using this modeltype I manage to take all the data but the "properties" I cannot take.
ModelType type = new ModelType();
type.setRecordName(null);
type.setRoot("docodel");
type.addField("nome", "nome");
type.addField("note", "note");
type.addField("oggetto", "oggetto");
type.addField("properties", "properties");
type.addField("uuid", "uuid");
MemoryProxy<ModelData> proxy = new MemoryProxy<ModelData>(jsonData);
JsonReader<List<ModelData>> reader = new JsonReader<List<ModelData>>(
type);
loader = new BaseListLoader<ListLoadResult<ModelData>>(proxy, reader);
ListStore<ModelData> store = new ListStore<ModelData>(loader);
loader.load();
How can I access that specific member which is a JSON Object ? Thanks a lot !