Den 22.06.2011 22:03, skrev Greg Brown:
I think this has come up before. BeanAdapter wraps a single bean instance and 
exposes its (immediate) properties via map methods. You can access nested 
properties using JSON.get(), put(), etc.

However, TableView does not currently expect paths in column names, only keys. 
It could be modified to use JSON.get() instead, but I'm on the fence about 
whether that is a good idea or not.

I think it looks like TableView already supports paths in column names. 
TableView#load calls:

JSON.get(context, tableDataKey)

and JSON#get will call parse on the tableDataKey, which seems to create an 
object navigational graph.

Right. We already made that change. So what is the problem you are running 
into? data.group seems like it should work as a column name.

It doesn't work because BeanAdapter tries to find the getterMethod for group in data (which is a Map) and it fails, since it is looking for "getData", when it should be looking for "get" with an argument of "data". It would require a couple of checks in the lines of if (Map.class.isAssignableFrom(beanClass)) to create a spesific getter method for Maps, and some other small stuff, but it could be implemented very cleanly without any performance hit.

-- Edvin

Reply via email to