Hi,
For some reasons, I have to create a class (IntList) that wraps a list
of Integers. (see below). I have made a simple test to send an
instance of this class in a simple RPC method
@Override
public void dummy(IntList l)
{
System.out.println("l="+l.toString());
}
I trigger the service as below
new Button("IntList",new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
service.dummy(new IntList(), new AsyncCallback<Void>()
{
@Override
public void onFailure(Throwable caught)
{
Window.alert(caught.getLocalizedMessage()+":"+caught.getCause());
}
@Override
public void onSuccess(Void result)
{
Window.alert("intlist success");
}
});
}
})
When testing, it fires a InvocationTargetException. Is there any
special thing I need to do with this class to make it usable as
argument of a RPC service ?
Thanks for your help.
--
K.WA
package com.xxxxxx;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import com.google.gwt.user.client.rpc.IsSerializable;
public class IntList implements Serializable, Iterable<Integer>,
IsSerializable
{
/**
*
*/
private static final long serialVersionUID = 1L;
protected ArrayList<Integer> list;
public IntList()
{
super();
list = new ArrayList<Integer>();
}
public IntList(int capacity)
{
super();
list = new ArrayList<Integer>(capacity);
}
public boolean add(int e)
{
return list.add(e);
}
public boolean contains(int o)
{
return list.contains(o);
}
public Integer get(int index)
{
return list.get(index);
}
public Iterator<Integer> iterator()
{
return list.iterator();
}
public int size()
{
return list.size();
}
}
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.