public Object next() { if (!inPagingMold()) return _it.next(); _count++; final Listitem item = (Listitem) _it.next(); return _it.hasNext() ? getVisibleRow(item) : item; }
public boolean hasNext() { if (!inPagingMold()) return _it.hasNext(); if (!_isBeginning && _count >= getPaginal().getPageSize()) { return false; } if (_count == 0 && !_isBeginning) { final Paginal pgi = getPaginal(); int begin = pgi.getActivePage() * pgi.getPageSize(); for (int i = 0; i < begin && _it.hasNext();) { getVisibleRow((Listitem) _it.next()); i++; } } return _it.hasNext(); }
/** * 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(); } }
try { final ListModel model = box.getModel(); boolean isPagingMold = box.inPagingMold(); int activePg = isPagingMold ? box.getPaginal().getActivePage() : 0; if (model != null) { //live data
if (inPagingMold()) { final int offset = _jsel - _jsel % getPageSize(); final int limit = getPageSize(); if (_jsel >= 0 && inPagingMold()) { final Listitem item = getItemAtIndex(_jsel); int size = getDataLoader().getOffset();
if (_pgi != null) throw new UiException("External paging cannot coexist with child paging"); if (!inPagingMold()) throw new UiException("The child paging is allowed only in the paging mold"); } else if (!(newChild instanceof Auxhead)) {
if (_paging == child && _pgi == child && inPagingMold()) throw new IllegalStateException( "The paging component cannot be removed manually. It is removed automatically when changing the mold");
} else if (inPagingMold() && cmd.equals(ZulEvents.ON_PAGE_SIZE)) { //since 5.0.2 final Map<String, Object> data = request.getData(); final int oldsize = getPageSize(); List<String> sitems = cast((List) data.get("items")); boolean selectAll = Boolean.parseBoolean(data.get("selectAll") + ""); boolean paging = inPagingMold(); Set<Listitem> prevSeldItems = new LinkedHashSet<Listitem>(_selItems); Set<Listitem> curSeldItems = AuRequests.convertToItems(desktop, sitems);
public void onAfterRender() { if (inPagingMold() && _model instanceof Pageable) { Pageable m = (Pageable) _model; if (m.getPageSize() > 0) { //min page size is 1 _pgi.setPageSize(m.getPageSize()); } else { m.setPageSize(_pgi.getPageSize()); } _pgi.setTotalSize(getDataLoader().getTotalSize()); if (m.getActivePage() >= 0) { //min page index is 0 _pgi.setActivePage(m.getActivePage()); } else { m.setActivePage(_pgi.getActivePage()); } } }
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); } } }
} else if (inPagingMold()) { // change to paging if (_pgi != null) addPagingListener(_pgi);
if (inPagingMold()) { if (old != null) removePagingListener(old);
try { int pgsz, ofs; if (inPagingMold()) { pgsz = _pgi.getPageSize(); ofs = _pgi.getActivePage() * pgsz;
setAttribute(Attributes.BEFORE_MODEL_ITEMS_RENDERED, Boolean.TRUE); if (inPagingMold()) {
if (inPagingMold()) { int totalSize = getDataLoader().getTotalSize(); if (isRemove && _model instanceof Pageable) {
if (sz != INIT_LIMIT) renderer.render("initRodSize", initRodSize()); if (!inPagingMold() && _jsel >= 0) renderer.render("_selInView", _jsel); // B50-ZK-56