Esempio n. 1
0
  @Override
  public void decode(FacesContext context, UIComponent component) {
    DataTable table = (DataTable) component;

    for (Iterator<DataTableFeature> it = DataTable.FEATURES.values().iterator(); it.hasNext(); ) {
      DataTableFeature feature = it.next();

      if (feature.shouldDecode(context, table)) {
        feature.decode(context, table);
      }
    }

    decodeBehaviors(context, component);
  }
Esempio n. 2
0
  @Override
  public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
    DataTable table = (DataTable) component;

    if (table.shouldEncodeFeature(context)) {
      for (Iterator<DataTableFeature> it = DataTable.FEATURES.values().iterator(); it.hasNext(); ) {
        DataTableFeature feature = it.next();

        if (feature.shouldEncode(context, table)) {
          feature.encode(context, this, table);
        }
      }
    } else {
      if (table.isLazy()) {
        if (table.isLiveScroll()) table.loadLazyScrollData(0, table.getScrollRows());
        else table.loadLazyData();
      }

      encodeMarkup(context, table);
      encodeScript(context, table);
    }
  }