Thursday, May 19, 2016

How to sort a list of objects from the shared folder on server-side?


I want to use Collections.sort() on a List<MyClass>. To do this, I have implemented Comparable<MyClass> in MyClass.
However, I need to access the database within the compareTo-method

class MyClass implements IsSerializable,Comparable<MyClass>
 public int compareTo(MyClass tgt)
Database d = new Database();

When I run this, I get "No source code is available for type Database. This is because Database is a server-side class while MyClass is in the shared folder.

Is it possible to move the compareTo-code to server-side somehow and still use Collections.sort?
If not, how would you solve this?


You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment