create a sortable class for a table


I have a table and by clicking on the column header of the table, the table are sorted by the column.
But this does not work with my own class.

table.addContainerProperty("lastname", MyXYZ.class, null); Which methods needs the class?
I’ve tried it with toString and getValue()

I have my own table class and i override the method formatPropertyValue to show the right values

@Override protected String formatPropertyValue(Object rowId, Object colId, Property<?> property) { Object v = property.getValue(); if (v instanceof MyXYZ) { MyXYZ xyz = (MyXYZ) v; return xyz.getValue(); } return super.formatPropertyValue(rowId, colId, property); } Has this something to do with the method getPropertyValue?


Similar Thread

thanks, that is exactly what i need