View Full Version : Need PagingLoadResult but get List from Server

22 Jul 2009, 6:03 AM

I am new to GXT and I am facing the following problem:

My service returns a "List<Incidents>":

public interface IncidentService extends RemoteService {
List<Incident> getIncidents(int offset, int pagesize);

public interface IncidentServiceAsync {
void getIncidents(int offset, int pagesize, AsyncCallback<List<Incident>> callback);
I am NOT using "PagingLoadResult" in my service on purpose, because I want to keep it generic. But when using the result in a client, I want to use it in a paged grid.

This is the current, none-working client code:

RpcProxy<PagingLoadResult<Incident>> proxy = new RpcProxy<PagingLoadResult<Incident>>() {
protected void load(Object loadConfig,
AsyncCallback<PagingLoadResult<Incident>> callback) {
service.getIncidents(0, 20, callback);

The problem is obvious: "callback" is defined as "AsyncCallback<PagingLoadResult<Incident>>" here and as "AsyncCallback<List<Incident>>" in the service.
What must I do, to get this working? How can I typecast that?

Thank you,

27 Aug 2009, 2:18 AM
have the same problem... any ideas?

27 Aug 2009, 8:26 AM
i would try to make a RpcProxy<List<Incident>> and add a reader which convert it to your PagingLoadResult<Incident> but i dont know if it is the right way.

27 Aug 2009, 9:11 AM

I was not able to fix the problem and I am using the whole PageConfig object now.