<zk>
<zscript><![CDATA[
class TestVM {
private int pageIndex = 0;
public int getPageIndex() {
return pageIndex;
}
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
}
Object[] data = new Object[12];
]]></zscript>
<window apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('TestVM')">
<intbox value="@bind(vm.pageIndex)"/>
<grid mold="paging" pageSize="3"
activePage="@bind(vm.pageIndex)">
<columns>
<column label="col"/>
</columns>
<rows>
<row forEach="${data }">Item</row>
</rows>
</grid>
<listbox mold="paging" pageSize="3"
activePage="@bind(vm.pageIndex)">
<listhead>
<listheader label="col"/>
</listhead>
<listitem forEach="${data }" label="Item"/>
</listbox>
</window>
</zk>