Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to order Vaadin Table Rows?

Tags:

java

sql

vaadin

I have a table phases that has values that reference to a repository table. In the repository each value has an order number.

Normally in SQL, I would join them and then order by the order column. But if I want to do that in Vaadin I have to use the FreeFormQuery to make this join.

The Problem is that I want to allow users to change values in the table phases. So I would need to implement the FreeFormQueryDelegate. Is there a way to make this work by using a standard TableQuery instead of a FreeFormQuery ?

Maybe manually move the rows in a table ?

like image 715
Norman Avatar asked Nov 01 '12 16:11

Norman


1 Answers

Vaadin offers some sort options for tables.

You can sort one specific propertyId or you can sort a set of properties.

// sort one container property Id
table.setSortContainerPropertyId(propertyId);
table.setSortAscending(ascending);
table.sort();

// sort several property Ids
table.sort(propertyId[], ascending[]);

NOTE: the code above is no proper code, it rather shows the method bodies.

like image 77
nexus Avatar answered Nov 11 '22 08:11

nexus