Vaadin 8, sorting grid, null values last

I’m having a Vaadin8-grid containing some Date-Columns. I need to get the grid sorted, so that the null-values of these columns are always at the end of the list, like this example:
(ascending)

  1. 01.02.2019
  2. 02.02.2019
  3. 03.02.2019
  4. null
  5. null

(descending)

  1. 03.02.2019
  2. 02.02.2019
  3. 01.02.2019
  4. null
  5. null

Sorting is done by clicking on the grid’s column header.

I tried to use

col.setComparator()

and also the Java8-Features like

Comparator.nullsLast()

…and wrapped them in a SerializableComparator.

Result ist always the same: one sorting-direction works fine (e.g. ascending) and as soon as you sort once again (by clicking the header) the null-values are on top of the list. I suppose that Collections.reverseOrder() is used which somehow kicks the Comparator?
Any ideas / suggestions on how to do that?

Hi Torsten,

I am facing the same issue. Did you find any solution yet?

Thanks

Hey Sajid,
unfortunately not - noone here with the same problem?

I have the same issue.
It would be great if this feature was available