brunonandolpho
20 May 2009, 12:00 PM
Hi guys,
i have a question about grid pagination with beans. A simple grid without pagination works well
I did all configurations that i see in the example
//CLIENT
RpcProxy proxy = new RpcProxy() {
public void load(Object loadConfig, final AsyncCallback callback) {
service.getMessage((PagingLoadConfig)config,callback;
}
BeanModelReader reader = new BeanModelReader();
BasePagingLoader loader = new BasePagingLoader(proxy);
loader.load(0, 15);
//SERVER SIDE
public PagingLoadResult<Message> getMessage(PagingLoadConfig config) {
ArrayList<Message> sublist = new ArrayList<Message>();
List<Message> list = messageService.getAllMessage();
int start = config.getOffset();
int limit = list.size();
if (config.getLimit() > 0) {
limit = Math.min(start + config.getLimit(), limit);
}
for (int i = config.getOffset(); i < limit; i++) {
sublist.add(list.get(i));
}
return new BasePagingLoadResult<Message>(sublist, config.getOffset(),
list.size());
}
when the grid starts, it doesnt show any datas....if a request a new search, the "loadin" box appears and nothing change....I guess i did everything right..
Can somebody help me?
i have a question about grid pagination with beans. A simple grid without pagination works well
I did all configurations that i see in the example
//CLIENT
RpcProxy proxy = new RpcProxy() {
public void load(Object loadConfig, final AsyncCallback callback) {
service.getMessage((PagingLoadConfig)config,callback;
}
BeanModelReader reader = new BeanModelReader();
BasePagingLoader loader = new BasePagingLoader(proxy);
loader.load(0, 15);
//SERVER SIDE
public PagingLoadResult<Message> getMessage(PagingLoadConfig config) {
ArrayList<Message> sublist = new ArrayList<Message>();
List<Message> list = messageService.getAllMessage();
int start = config.getOffset();
int limit = list.size();
if (config.getLimit() > 0) {
limit = Math.min(start + config.getLimit(), limit);
}
for (int i = config.getOffset(); i < limit; i++) {
sublist.add(list.get(i));
}
return new BasePagingLoadResult<Message>(sublist, config.getOffset(),
list.size());
}
when the grid starts, it doesnt show any datas....if a request a new search, the "loadin" box appears and nothing change....I guess i did everything right..
Can somebody help me?