Table sort only for header left click

Hello,

I have the following problem.

I want to sort a tabel column only when a left mouse click event is fired on table header. In default case of sorting on every mouse click on the table header the table was sorted by this column.

I’ve tested two solutions:

  1. Set table.setSortDisabled(true); on right-click and for “false” on left-click, but then the sort event will done first and the parameter will be set for the next mouse table header click. So it not work.
  2. Set SortDisabled(true) and work with:
sortascending=!sortascending;
table.setSortAscending(sortascending);
table.setSortContainerPropertyId(event.getPropertyId());

This will sort the table by the correct column but there will no sort-direction-arrow will be shown on the right part of the column.

Has anyone an idea?

Thanks.
Nikolai