View Full Version : Paging Grid problem

22 Nov 2009, 2:58 PM
Hi !

I coded my grid based on the example - i however have slight problems with defining service itself ...

My grid displays lines of type Zabytek in an arrayList - my implementation is as follows :

public class ServiceTestImpl implements ServiceTest {

public PagingLoadResult<ModelData> getZabytki(PagingLoadConfig lc) {
List<ModelData> list = new ArrayList<ModelData>();
list.add(new Zabytek("1","1","1","1","1"));
list.add(new Zabytek("2","2","2","2","2"));
list.add(new Zabytek("3","3","3","3","3"));
list.add(new Zabytek("4","4","4","4","4"));
BasePagingLoadResult<ModelData> pr = new BasePagingLoadResult<ModelData>(list);
return pr;

}And interfaces are :

public interface ServiceTest extends RemoteService{
public PagingLoadResult<ModelData> getZabytki(PagingLoadConfig lc);
public interface ServiceTestAsync {
public void getZabytki(PagingLoadConfig lc, AsyncCallback<PagingLoadResult<ModelData>> callback);
}And i get the following Exception :

[ERROR] Deferred binding result type 'com.pl.jzebrowski.client.ServiceTestAsync' should not be abstract

Could someone point me how should i define my services so it all could work ok ?

Also - i have actions that modify contents of the grid via forms - i dont want to reload whole dataset when user performs an action... so should i access the DataStore to delete/edit/add grid data ?

25 Nov 2009, 2:44 PM
Your ServiceTestImpl should extend RemoteServiceServlet; also for paging to work, you should include more information in the BasePagingLoadResult you're sending the the client - it has a second constructor, accepting limit and offset - make sure you include these in.