Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Vaadin Table not sortable via header click with LazyQueryContainer #81

Closed
mamuf opened this issue Sep 30, 2015 · 1 comment
Closed

Vaadin Table not sortable via header click with LazyQueryContainer #81

mamuf opened this issue Sep 30, 2015 · 1 comment

Comments

@mamuf
Copy link

mamuf commented Sep 30, 2015

Hi, I found a strange behaviour of Table in combination with LazyQueryContainer. When I use, for example, the IndexedContainer from Vaadin and set Table's sortEnabled to true, header click sorts the container by selected column as expected. But when I replace the container with LazyQueryContainer with custom bean Query (via BeanQueryFactory), clicking on the table's header seems to do nothing at all. I can "fix" this by adding HeaderClickListener to the table and invoke the Table.sort() method myself but then the sorting indicators are not removed from the columns that are not sorted.

I am not sure where the problem might be, I have tried to analyze and compare the code of LQC and IndexedContainer, compare implemented interfaces since Table behaviour is partially derived from what the container can do. I can't find anything that may be the source of this.

Note that I first encountered this issue when using the FilteringTable addon by Teppo Kurki but it behaves the same when I use the vanilla Table.

I am using Vaadin 7.5.6 and LQC addon 7.4.0.1 which includes the #71 fix sou this must be something different. I can write a small demo project if that helps. I only tried this in my work project.

@mamuf
Copy link
Author

mamuf commented Sep 30, 2015

Ok, I have discovered that the LQC's implementation of Container.addContainerProperty(Object, Class, Object) method sets internal sortable flag to false by default and that the LQC provides another method: addContainerProperty(Object, Class, Object, boolean, boolean) in which the last parameter is the sortable flag. So I could fix my problem now but I still think the default behaviour of the first method should be something like checking if given property class implements java.lang.Comparable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants