Re: jsinterop: converting a jre collection to a jsArray

2016-05-19 Thread Vassilis Virvilis
I agree I am just saying that java String is not the same as the js String. So String[] cannot be converted easily to a js string array. I agree that arrays in other @JsType objects works as expected. The main difference if I understand your point of view is that I have to create a js string arr

Re: jsinterop: converting a jre collection to a jsArray

2016-05-19 Thread Kirill Prazdnikov
It would be nice to have a way to convert arrays and string to\from Js shipped by the compiler A documented way to pass java.lang.String or byte[] to JS. On Thursday, May 19, 2016 at 11:06:12 AM UTC+3, Vassilis Virvilis wrote: > > I agree > > I am just saying that java String is not the same

Re: jsinterop: converting a jre collection to a jsArray

2016-05-19 Thread Vassilis Virvilis
I don't know if this is possible... It would be great if GWT compiler could do this automatically every time it breaks to or returns from js code. Checking... Oups GWT is actually doing that already. This code works equally well @JsType(isNative = true, namespace = JsPackage.GLOBAL, name =

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();

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 t

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

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 gr

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

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 wro