use of org.zkoss.zul.Paging in project adempiere by adempiere.
the class ListPanel method render.
private void render() {
ThemeUtils.addSclass("adtab-grid-panel", this);
listbox.setVflex(true);
listbox.setFixedLayout(true);
listbox.addEventListener(Events.ON_SELECT, this);
ThemeUtils.addSclass("adtab-grid", listbox);
updateModel();
Center center = new Center();
center.appendChild(listbox);
this.appendChild(center);
if (pageSize > 0) {
paging = new Paging();
paging.setPageSize(pageSize);
paging.setTotalSize(tableModel.getRowCount());
paging.setDetailed(true);
south.appendChild(paging);
paging.addEventListener(ZulEvents.ON_PAGING, this);
renderer.setPaging(paging);
this.getParent().invalidate();
} else {
south.setVisible(false);
}
}
use of org.zkoss.zul.Paging in project adempiere by adempiere.
the class GridPanel method init.
/**
*
* @param gridTab
*/
public void init(GridTab gridTab) {
if (init)
return;
this.gridTab = gridTab;
tableModel = gridTab.getTableModel();
numColumns = tableModel.getColumnCount();
gridField = ((GridTable) tableModel).getFields();
// Create columns and append them to the listbox(Grid)
setupColumns();
// Create the model and attach to listmodel
// causes a re-render event
updateModel();
if (pageSize > 0) {
paging = new Paging();
paging.setPageSize(pageSize);
paging.setTotalSize(tableModel.getRowCount());
paging.setDetailed(true);
south.appendChild(paging);
paging.addEventListener(ZulEvents.ON_PAGING, this);
renderer.setPaging(paging);
} else {
south.setVisible(false);
}
updateListIndex();
// Triggers a re-render
listbox.setModel(listModel);
this.init = true;
}
use of org.zkoss.zul.Paging in project adempiere by adempiere.
the class InfoPanel method renderItems.
protected void renderItems() {
if (m_count > 0) {
if (m_count > PAGE_SIZE) {
if (paging == null) {
paging = new Paging();
paging.setPageSize(PAGE_SIZE);
paging.setTotalSize(m_count);
paging.setDetailed(true);
paging.addEventListener(ZulEvents.ON_PAGING, this);
insertPagingComponent();
} else {
paging.setTotalSize(m_count);
paging.setActivePage(0);
}
List<Object> subList = readLine(0, PAGE_SIZE);
model = new ListModelTable(subList);
model.setSorter(this);
model.addTableModelListener(this);
p_table.setData(model, null);
pageNo = 0;
} else {
if (paging != null) {
paging.setTotalSize(m_count);
paging.setActivePage(0);
pageNo = 0;
}
model = new ListModelTable(readLine(0, -1));
model.setSorter(this);
model.addTableModelListener(this);
p_table.setData(model, null);
}
} else // metas c.ghita@metas.ro : start
{
model = new ListModelTable();
p_table.setData(model, null);
}
// metas c.ghita@metas.ro : start
int no = m_count;
setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false);
setStatusDB(Integer.toString(no));
addDoubleClickListener();
}
Aggregations