Example #1
0
  private void adjustLoggersTablePage(TablePanel loggersTable, LoggingDto dto) {
    if (loggersTable != null && dto.getLoggers().size() > 10) {
      DataTable table = loggersTable.getDataTable();

      if (table != null) {
        table.setCurrentPage((long) (dto.getLoggers().size() / 10));
      }
    }
  }
  private void searchPerformed(AjaxRequestTarget target) {
    ObjectQuery query = createQuery();

    TablePanel panel = getTable();
    DataTable table = panel.getDataTable();
    AccountContentDataProvider provider = (AccountContentDataProvider) table.getDataProvider();
    provider.setQuery(query);
    table.setCurrentPage(0);

    target.add(panel);
    target.add(getFeedbackPanel());
  }
  private void clearSearchPerformed(AjaxRequestTarget target) {
    searchModel.setObject(new AccountContentSearchDto());

    TablePanel panel = getTable();
    DataTable table = panel.getDataTable();
    AccountContentDataProvider provider = (AccountContentDataProvider) table.getDataProvider();
    provider.setQuery(null);

    ResourcesStorage storage = getSessionStorage().getResources();
    storage.setAccountContentSearch(searchModel.getObject());
    storage.setAccountContentPaging(null);
    panel.setCurrentPage(null);

    target.add(get(ID_SEARCH_FORM));
    target.add(panel);
  }