DataTable generics vs. IColumn generics

2015-03-05 Thread Patrick Davids
Hi all, whats the meaning of generic T on DataTables vs T of IColumn and T of ICellPopulator? As I understand its the type of object shown by the table rows. Reading the javadoc of AbstractColumn it says T (if I understand correct), its the type of object shown by the cell itself. But DataT

Re: DataTable generics vs. IColumn generics

2015-03-05 Thread Sven Meier
Hi, generic T is identical for the DataTable, and it's IColumns: it's the type of the row models. A column is responsible to provide a cell component for a row: For DataTable only the input (e.g. Person) is interesting, the output (Location) doesn't matter. Your LocationColumn should exten

Re: DataTable generics vs. IColumn generics

2015-03-05 Thread Patrick Davids
Hi Sven, thanx for feedback. Ok, how to implement the LocationColumn more reusable? I dont want to be bound to a Datatable of Persons. I'd like to have a Column which works with a Locations, independently from which model-object the expression fetches the Location. Is there any way to do that

Re: DataTable generics vs. IColumn generics

2015-03-05 Thread Sven Meier
Hi Patrick, you can let your column implementation be generic: public class LocationColumn extends PropertyColumn { public LocationColumn(String expressionToLocation){ super(Model.of("Location"), expressionToLocation); } @Override public vo

Re: DataTable generics vs. IColumn generics

2015-03-09 Thread Patrick Davids
Hi Sven, I did already implement it this way... and its working. But my team members asked (more the client developers point of view), why the column-class itself is not a generic of Location, like this. public class LocationColumn extends PropertyColumn { ... } At the current implementation

Re: DataTable generics vs. IColumn generics

2015-03-10 Thread Sven Meier
Hi, >At the current implementation they need to do >cols.add(new LocationColum(...)); >instead of just >cols.add(new LocationColum(...)); I think you mean LocationColumn. >nice feature of PropertyColums: Not to have a too strength coupling of what the column displays in the cell and what the d