Example #1
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);
  }
Example #2
0
 /**
  * Internal use only.
  *
  * @since 6.5.0
  */
 public void onGroupLater(SortEvent event) {
   group(event.isAscending());
 }
Example #3
0
 /**
  * Invokes a sorting action based on a {@link SortEvent} and maintains {@link #getSortDirection}.
  *
  * @since 6.5.0
  */
 public void onSort(SortEvent event) {
   sort(event.isAscending());
 }