PDA

View Full Version : Mapping complex object with array in JsonReader



mtigua
3 Mar 2010, 7:29 AM
Helo everyone,

I need to map this json object in a JsonReader:

{"paciente":{"categorias":[{"nombre":"Diabetico","id":1},{"nombre":"Bulimico","id":2}],"fechaActualizacion":"03/03/2010" ,direccionComercial":{"comuna":{}}}

I have this in an JsonFormPanel:

url: 'seam/resource/rest/pacientesvc/actualizar',
method:'POST',
reader: new Ext.data.JsonReader({
root: 'paciente',
fields: [
{name: 'fechaActualizacion', type:'string'},
{name:'comunadircomercialId',mapping:'direccionComercial.comuna.id',type:'string'}
]

The question is : How must it be the mapping for array "categorias" ?

Thanks in advance.