Table sort does not work on group by query from a service

Hi

See project attached. I was under the impression that Vaadin Table is able to sort in memory, I don’t understand why it does not work.

If the Table is not able to sort in memory, I would be interested in a workaround to catch the clic on the column headers to sort myself. It’s so trivial.

tablesortgroupby.zip (87.1 KB)

Regards
Michael

Hi Michael,

Add a sorter to your programmatically created container:

CollectionContainer<KeyValueEntity> dc = new CollectionContainerImpl<>(mc);
dc.setSorter(new CollectionContainerSorter(dc, null));

Or better consider creating data containers through the DataComponents factory.

Hi @krivopustov

Thank you.

Or like @gorelov advised me here, developpers should use DataComponents which sets the sorter.

Michael