Exemple #1
0
  // super
  protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
      throws java.io.IOException {
    super.renderProperties(renderer);

    if (!"none".equals(_sortDscNm)) render(renderer, "sortDescending", _sortDscNm);

    if (!"none".equals(_sortAscNm)) render(renderer, "sortAscending", _sortAscNm);

    if (!"natural".equals(_sortDir)) render(renderer, "sortDirection", _sortDir);

    if (_maxlength > 0) renderer.render("maxlength", _maxlength);

    org.zkoss.zul.impl.Utils.renderCrawlableText(getLabel());
  }
Exemple #2
0
  /**
   * Processes an AU request.
   *
   * <p>Default: in addition to what are handled by its superclass, it also handles onSort.
   *
   * @since 6.5.0
   */
  public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
    final String cmd = request.getCommand();
    if (cmd.equals(Events.ON_SORT)) {
      SortEvent evt = SortEvent.getSortEvent(request);
      Events.postEvent(evt);
    } else if (cmd.equals(Events.ON_GROUP)) {
      final Map<String, Object> data = request.getData();
      final boolean ascending = AuRequests.getBoolean(data, "");
      Events.postEvent(new SortEvent(cmd, this, ascending));

      // internal use, and it should be invoked after onGroup event.
      Events.postEvent(-1000, new SortEvent("onGroupLater", this, ascending));
    } else if (cmd.equals(Events.ON_UNGROUP)) {
      final Map<String, Object> data = request.getData();
      final boolean ascending = AuRequests.getBoolean(data, "");
      ungroup(ascending);
      Events.postEvent(new SortEvent(cmd, request.getComponent(), ascending));
    } else super.service(request, everError);
  }
Exemple #3
0
 // B70-ZK-1816, also add in zk 8, ZK-2660
 protected void updateByClient(String name, Object value) {
   if ("visible".equals(name)) this.setVisibleDirectly(((Boolean) value).booleanValue());
   else super.updateByClient(name, value);
 }
Exemple #4
0
 // -- Component --//
 public void beforeParentChanged(Component parent) {
   if (parent != null && !(parent instanceof Listhead))
     throw new UiException("Wrong parent: " + parent);
   super.beforeParentChanged(parent);
 }