In javascript console, if I do this,
a = [1,2,3] Object.prototype.toString.call(a) // gives me "[object Array]" typeof a // gives me "object"
If I create an arraylist in GWT and pass it to the native method and do it,
What is the difference between the two? Is GWTJavaObject exactly similar to an Array ?
Why typeof returns an “ object ” in pure javascript but a “ function ” in GWT?
Consolidated question: in what exactly are GWT objects converted to Javascript? The full code is here.
public void onModuleLoad() { List<Integer> list = new ArrayList<Integer>(); list.add( new Integer( 100 ) ); list.add( new Integer( 200 ) ); list.add( new Integer( 300 ) ); Window.alert(nativeMethodCode( list )); Window.alert(nativeMethodCode2( list )); } public static final native Object nativeMethodCode( Object item ) ; public static final native Object nativeMethodCode2( Object item ) ;
LPD
source share