Package org.zkoss.zul.ext

Examples of org.zkoss.zul.ext.Paginal


   * "paging", a paging controller is created automatically as a child
   * component (see {@link #getPagingChild}).
   */
  public void setPaginal(Paginal pgi) {
    if (!Objects.equals(pgi, _pgi)) {
      final Paginal old = _pgi;
      _pgi = pgi; // assign before detach paging, since removeChild
      // assumes it

      if (inPagingMold()) {
        if (old != null)
View Full Code Here


    if (_pgImpListener == null)
      _pgImpListener = new EventListener() {
        public void onEvent(Event event) {
          if (_model != null && inPagingMold()) {
            final Paginal pgi = getPaginal();
            int pgsz = pgi.getPageSize();
            final int ofs = pgi.getActivePage() * pgsz;
            if (_rod) {
              getDataLoader().syncModel(ofs, pgsz);
            }
            postOnInitRender();
          }
          invalidate();
        }
      };
    pgi.addEventListener("onPagingImpl", _pgImpListener);
  }
View Full Code Here

  /* package */void addVisibleItemCount(int count) {
    if (count != 0) {
      _visibleItemCount += count;
      if (inPagingMold()) {
        final Paginal pgi = getPaginal();
        pgi.setTotalSize(getDataLoader().getTotalSize());
        invalidate(); // the set of visible items might change
      } else if (((Cropper) getDataLoader()).isCropper()) {
        getDataLoader().updateModelInfo();
      } else {
        smartUpdate("visibleItemCount", _visibleItemCount);
View Full Code Here

      if (!defer || !rod) { //if attached and rod, defer the model sync
        getDataLoader().syncModel(-1, -1);
      } else if (inPagingMold()) {
        //B30-2129667, B36-2782751, (ROD) exception when zul applyProperties
        //must update paginal totalSize or exception in setActivePage
        final Paginal pgi = getPaginal();
        pgi.setTotalSize(getDataLoader().getTotalSize());
      }
      postOnInitRender();
      // Since user might setModel and setItemRender separately or
      // repeatedly,
      // we don't handle it right now until the event processing phase
View Full Code Here

              .iterator().next() : null;
          selectItem(item);
        } else {
          int from, to;
          if (paging) {
            final Paginal pgi = getPaginal();
            int pgsz = pgi.getPageSize();
            from = pgi.getActivePage() * pgsz;
            to = from + pgsz; // excluded
          } else {
            from = to = 0;
          }

View Full Code Here

      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++;
        }
      }
View Full Code Here

        Executions.getCurrent().removeAttribute("zkoss.Listbox.deferInitModel_"+getUuid());
      }
      final DataLoader loader = getDataLoader();

      // initialize paginal if any
      Paginal pgi = getPaginal();
      if (pgi != null)
        pgi.setTotalSize(loader.getTotalSize());
    }
View Full Code Here

    };
  }

  void addVisibleItemCount(int count) {
    if (inPagingMold()) {
      Paginal pgi = getPaginal();
      pgi.setTotalSize(pgi.getTotalSize() + count);
      invalidate(); //the set of visible items might change
    }
  }
View Full Code Here

   * Returens a map of current visible item.
   * @since 3.0.7
   */
  Map getVisibleItems() {
    Map map = new HashMap();
    final Paginal pgi = getPaginal();
    final int pgsz = pgi.getPageSize();
    final int ofs = pgi.getActivePage() * pgsz;
   
    // data[pageSize, beginPageIndex, visitedCount, visitedTotal, RenderedCount]
    int[] data = new int[]{pgsz, ofs, 0, 0, 0};
    getVisibleItemsDFS(getChildren(), map, data);
    return map;
View Full Code Here

   * (see {@link #getPagingChild}).
   * @since 3.0.7
   */
  public void setPaginal(Paginal pgi) {
    if (!Objects.equals(pgi, _pgi)) {
      final Paginal old = _pgi;
      _pgi = pgi; //assign before detach paging, since removeChild assumes it

      if (inPagingMold()) {
        if (old != null) removePagingListener(old);
        if (_pgi == null) {
View Full Code Here

TOP

Related Classes of org.zkoss.zul.ext.Paginal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.