From 2cfa64db4f709e74b0bbb0a83d3a31d754fd874e Mon Sep 17 00:00:00 2001 From: Juuso Valli Date: Wed, 23 Apr 2014 15:46:16 +0300 Subject: Fix Table.sort(...) to update the sort indicator (#8978) Change-Id: I2df7de7648a8a311a913267ef0d0d0e57f52f19d --- server/src/com/vaadin/ui/Table.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'server/src') diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java index e23a1bf688..85019a979c 100644 --- a/server/src/com/vaadin/ui/Table.java +++ b/server/src/com/vaadin/ui/Table.java @@ -4751,7 +4751,15 @@ public class Table extends AbstractSelect implements Action.Container, if (refreshingPreviouslyEnabled) { enableContentRefreshing(true); } - + if (propertyId.length > 0 && ascending.length > 0) { + // The first propertyId is the primary sorting criterion, + // therefore the sort indicator should be there + sortAscending = ascending[0]; + sortContainerPropertyId = propertyId[0]; + } else { + sortAscending = true; + sortContainerPropertyId = null; + } } else if (c != null) { throw new UnsupportedOperationException( "Underlying Data does not allow sorting"); -- cgit v1.2.3