You should implement your own BeanModel and it can do whatever it wants.
As far as I know, you don't need to implement all of the methods,
assuming you aren't using the model for editing. I implemented
getBeanType (to return Object[].class), newInstance, getPropertyName,
get and getById. My grids seem happy with this model.
Norman Franke
Answering Service for Directors, Inc.
www.myasd.com
On Oct 3, 2011, at 4:17 PM, cqasker wrote:
Well I guess another week, another conundrum. I hope maybe you guys
have some
suggestions
So say I have a Bean like:
public class Bean
{
private String name;
private Map<String, Integer> map;
public String getName() { return name;}
public Integer getMap(String columnHeader) {return
map.get(columnHeader);}
}
So basically I need a table where the column headers are the keys of
map,
and the column cells have the map's values.
How can I tell the BeanModel to grab "getMap('columndHeader')"
instead of
just a simple property? I don't mind implementing a new BeanModel
implementation to accomodate this requirement. Unfortunately I don't
know
the columnHeaders or even all the possibilities as they are constantly
changed, added, removed from a datasource so I can't create a method
like
public Integer getColumnA()
{return map.get("A");}
Is it possible to modify the grid to take an expression on the bean
and then
execute the expression on the bean to get the grid cell value.
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Grid-is-there-any-way-dynamically-defined-columns-tp4866376p4866376.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org