/** * Checks whether to invalidate, when a child has been added or or will be * removed. * * @param bRemove * if child will be removed */ private void checkInvalidateForMoved(Listitem child, boolean bRemove) { // No need to invalidate if // 1) act == last and child in act // 2) act != last and child after act // Except removing last elem which in act and act has only one elem if (inPagingMold() && !isInvalidated()) { final int j = child.getIndex(), pgsz = getPageSize(), n = (getActivePage() + 1) * pgsz; if (j >= n) return; // case 2 final int cnt = getItems().size(), n2 = n - pgsz; if (j >= n2 && cnt <= n && (!bRemove || cnt > n2 + 1)) return; // case 1 invalidate(); } }
listbox.invalidate();
listbox.invalidate();
public boolean setVisible(boolean visible) { if (isVisible() == visible) return visible; final boolean result = super.setVisible(visible); final Listbox listbox = (Listbox) getParent(); if (listbox != null) { if (listbox.inSelectMold()) listbox.invalidate(); final Listgroup g = listbox.getListgroupAt(getIndex()); if (g == null || g.isOpen()) listbox.addVisibleItemCount(visible ? 1 : -1); } // Bug ZK-485, send after invoking listbox.addVisibleItemCount() smartUpdate("visible", visible); return result; }
lstVitals.invalidate(); setSelectedRow(selectedItem);
postOnInitRender(); invalidate(); // paging mold -> non-paging mold } else if (inPagingMold()) { // change to paging if (_pgi != null) invalidate(); // non-paging mold -> paging mold
public void onEvent(Event event) { if (_model != null && inPagingMold()) { final Paginal pgi = getPaginal(); int pgsz = pgi.getPageSize(); int ofs = pgi.getActivePage() * pgsz; if (event instanceof PagingEvent) { // Bug ZK-1696: PagingEvent have the newest paging information pgsz = ((PagingEvent) event).getPageable().getPageSize(); ofs = ((PagingEvent) event).getActivePage() * pgsz; } if (_model instanceof Pageable) { ((Pageable) _model).setPageSize(pgsz); ((Pageable) _model).setActivePage(pgi.getActivePage()); } if (_rod) { getDataLoader().syncModel(ofs, pgsz); } postOnPagingInitRender(); } invalidate(); }
/* package */void addVisibleItemCount(int count) { if (count != 0) { _visibleItemCount += count; if (inPagingMold()) { final Paginal pgi = getPaginal(); int totalSize = getDataLoader().getTotalSize(); if (count < 0 && _model instanceof Pageable) { Pageable p = (Pageable) _model; int actpg = p.getActivePage(); int maxPageIndex = p.getPageCount() - 1; if (actpg > maxPageIndex) { p.setActivePage(maxPageIndex); } } pgi.setTotalSize(totalSize); invalidate(); // the set of visible items might change } else if (((Cropper) getDataLoader()).isCropper()) { getDataLoader().updateModelInfo(); } else { smartUpdate("visibleItemCount", _visibleItemCount); } } }
return; if ((oldsz <= 0 || cnt > INVALIDATE_THRESHOLD) && !inPagingMold()) _listbox.invalidate(); _listbox.invalidate();
int diff = Math.abs((model != null ? model.getSize() : 0) - _model.getSize()); if (diff > threshold) invalidate();
_listbox.invalidate(); _listbox.invalidate();