package zk.support.paging; import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.NotifyChange; public class PagingViewModel { int pageSize = 10; int totalSize = 100; int activePage = 5; @Command("onPaging") public void onPaging() { System.out.println("onPaging"); } @Command("changePage") @NotifyChange("activePage") public void onChangePage() { activePage = (int)(Math.random() * (totalSize / pageSize)); } public int getPageSize() { return pageSize; } public int getTotalSize() { return totalSize; } public int getActivePage() { System.out.println("getActivePage"); return activePage; } public void setActivePage(int activePage) { System.out.println("setActivePage"); this.activePage = activePage; } }