PDA

View Full Version : Pagination Grid not works



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?

chinnapandu
20 May 2009, 2:21 PM
check in the firbug and see wether you get data from server side. If not then you are doing some mistake in client side code

brunonandolpho
21 May 2009, 4:03 AM
Thanks for the help...i use the firebug, but all data are recovered..
I think the problem is when data passing to the grid...
I forgot to say before, my class message already implements BeanModelTag..
Did I have to make another configuration in client code? call onRender againt ? my code is almost the same in the example PagingBeanModelGridExample

By the way, when the grid is rendered, the toolbar is not updated too..
I think it is a basic stuff and I have a lot of dificult to make it works =/

brunonandolpho
21 May 2009, 6:12 AM
guys, i solve the problem..thanks for help.. it was a simple thing..i did not put the beanmodelreader and other stufft...thanks a lot