Reading JSON into BeanModel instead of DataModel
I have a Grid based on a HttpProxy that access a web service returning JSON.
I have a Java bean implementing the BeanModelTag that matches the property of the returned JSON.
I need to display some JSON properties on the Grid and access all JSON properties when I click on a row of the Grid.
The ugly way I found out is not to use my Java bean and instead
Ideally I would have a HttpProxy and a DataReader that would read my JSON into a BeanModel with the underlying Java Bean, so I can always access my Java bean when I need to access some properties.
- use a JsonLoadResultReader
- and defined a custom ModelType, adding all the JSON properties (which i would have in my Java bean already)
- then load ModelData into my ListStore
- when I 'm reading this ModelData on e.g. a SelectionEvent, I need to do a model.get(<json property string>)
Is there any easy way to do that?
Or if I would need to write my own DataReader, which JSON unmarshaller library would be suited for this job?