pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomas Stenlund <tomas.stenl...@telia.com>
Subject TableViewRowEditor or actually ListAdapter throws InstantiationException
Date Thu, 12 Jul 2012 05:34:21 GMT

I'm using Pivot 2.0.2 and have come across something which I would 
gladly have some good suggestions around.

In a TableView I have a tableDataKey that points to a "get" method that 
is implemented by the the object I load into the form. The get method 
returns a ListAdapter wrapping a list of objects (Apache Cayenne 
ToManyList). What I have seens is that the list I wrap up doesn't have 
an empty constructor, causing the ListAdapter to throw an 
instantiantionexception when using the remove(in,in) method since it 
does a getClass().newInstance of that list.

The ListView works perfectly, but as soon as I have a 
TableSortViewListener that adds a comparator to the tableData it behaves 
differently. The endEdit method of the TableViewRowEditor then does a 
remove described above causing the exception.

So, is there a good way of doing this differently that does not cause 
this ? I got it to work when I made a new "real" pivot list from the 
cayenne ToManyList instead of wrapping up the cayenne ToManyList with 
the ListAdapter. But I think that is kind of "ugly" since I do got the 
ListAdapter specifically for this purpouse and the ToManyList implements 
a List and is also automatically generated by Cayenne for me.

Anyone come across something similar ?



View raw message