-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
i want to handel my listbox with paging so i put as this:
listbox.setMold("paging");
Paging page = listbox.getPagingChild();
page.setMold("os");
page.setTotalSize(10);
page.setPageSize(2);
redraw(0, PAGE_SIZE);
what i want to do is to put my paging to support 10 items but in effect for every request io fetch the suitable items fo the current page
final int PAGE_SIZE = 2;
page.addEventListener("onPaging", new EventListener() {
public void onEvent(Event event) {
PagingEvent pe = (PagingEvent) event;
int pgno = pe.getActivePage();
int ofs = pgno * PAGE_SIZE;
logger.info("the pageeeeeeeeeee is " + ofs);
// Redraw current paging
redraw(ofs, PAGE_SIZE);
}
});
the problem is that for my first load the paging is put to 1 it is if setTotalSize is ignored????? please help
Hi,
setTotalSize means that set the total items to the page, and setPageSize means that set the number of items per page.
/Jumper
i know this but what i wanted to say is if i put:
Paging page = listbox.getPagingChild();
page.setMold("os");
page.setTotalSize(100);
it must make my paging supports 100 items even though i didn't fill all them. and this is used for perfermance of database. ,it means i indicate that a total i have 100 but for every time the client do paging i load the rests.
Bon j'ai resolu le problème merci beaucoup.
Hi,
I don't know why you need to load the rests.
In the paging event, you have only to load the items being displayed on current page.
/Jumper
yes that what i have done all thanks
Asked: 2009-03-15 13:40:51 +0800
Seen: 219 times
Last updated: Mar 17 '09