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

2016-05-25 Thread Magnus


On Thursday, May 19, 2016 at 7:12:59 PM UTC+2, Jens wrote:
>
> Don't implement Comparable in your shared class but instead use 
> Collections.sort(List, Comparator) on your server. The comparator can then 
> only live on the server.
>
 
This works fine! Thank you!

Magnus

-- 
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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


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

2016-05-19 Thread Vassilis Virvilis
Nope they don't

http://docs.oracle.com/javase/8/docs/api/java/util/Collections.html#sort-java.util.List-java.util.Comparator-

On Thu, May 19, 2016 at 8:15 PM, Kirill Prazdnikov 
wrote:

> Collections.sort requires only Comparable
>
> On Thursday, May 19, 2016 at 7:57:39 PM UTC+3, natan aguiar wrote:
>>
>> There is something strictly gwt / js is easily possible. Being only be
>> required to have "extends IsSerializable"
>>
>> --
> 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 google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Vassilis Virvilis

-- 
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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


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

2016-05-19 Thread Kirill Prazdnikov
Collections.sort requires only Comparable 

On Thursday, May 19, 2016 at 7:57:39 PM UTC+3, natan aguiar wrote:
>
> There is something strictly gwt / js is easily possible. Being only be 
> required to have "extends IsSerializable"
>
>

-- 
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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


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

2016-05-19 Thread Jens
Don't implement Comparable in your shared class but instead use 
Collections.sort(List, Comparator) on your server. The comparator can then 
only live on the server.

-- J.

-- 
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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


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

2016-05-19 Thread natan clara

  
  
There is something strictly gwt / js is easily possible. Being only
be required to have "extends IsSerializable"

Em 19/05/2016 12:39, Kirill Prazdnikov
  escreveu:


  

  
Is it possible to move the compareTo-code to
  server-side somehow and still use Collections.sort?

  



I think you can move any part of you project to another
  part.
For example it is possible to move or copy-paste a class
  from the client code to the serve code.
Isn`t it ? 


  
  -- 
  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 google-web-toolkit+unsubscr...@googlegroups.com.
  To post to this group, send email to google-web-toolkit@googlegroups.com.
  Visit this group at https://groups.google.com/group/google-web-toolkit.
  For more options, visit https://groups.google.com/d/optout.


  




-- 
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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


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

2016-05-19 Thread Kirill Prazdnikov

>
> Is it possible to move the compareTo-code to server-side somehow and still 
> use Collections.sort?
>

I think you can move any part of you project to another part.
For example it is possible to move or copy-paste a class from the client 
code to the serve code.
Isn`t it ? 

-- 
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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


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

2016-05-19 Thread Magnus
Hello,

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

class MyClass implements IsSerializable,Comparable
{
...
 public int compareTo(MyClass tgt)
 {
 Database d = new Database();
 d.loadSomething();
...
 }
}


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?

Thanks
Magnus

-- 
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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.