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); }
private void initLayout() { Form searchForm = new Form(ID_SEARCH_FORM); add(searchForm); CheckBox nameCheck = new CheckBox(ID_NAME_CHECK, new PropertyModel(searchModel, AccountContentSearchDto.F_NAME)); searchForm.add(nameCheck); CheckBox identifiersCheck = new CheckBox( ID_IDENTIFIERS_CHECK, new PropertyModel(searchModel, AccountContentSearchDto.F_IDENTIFIERS)); searchForm.add(identifiersCheck); BasicSearchPanel<AccountContentSearchDto> basicSearch = new BasicSearchPanel<AccountContentSearchDto>(ID_BASIC_SEARCH) { @Override protected IModel<String> createSearchTextModel() { return new PropertyModel<>(searchModel, AccountContentSearchDto.F_SEARCH_TEXT); } @Override protected void searchPerformed(AjaxRequestTarget target) { PageContentAccounts.this.searchPerformed(target); } @Override protected void clearSearchPerformed(AjaxRequestTarget target) { PageContentAccounts.this.clearSearchPerformed(target); } }; searchForm.add(basicSearch); Form mainForm = new Form(ID_MAIN_FORM); add(mainForm); AccountContentDataProvider provider = new AccountContentDataProvider( this, new PropertyModel<String>(resourceModel, "oid"), createObjectClassModel(), createUseObjectCountingModel()) { @Override protected void addInlineMenuToDto(AccountContentDto dto) { addRowMenuToTable(dto); } }; provider.setQuery(createQuery()); List<IColumn> columns = initColumns(); TablePanel table = new TablePanel( ID_TABLE, provider, columns, UserProfileStorage.TableId.PAGE_RESOURCE_ACCOUNTS_PANEL, getItemsPerPage(UserProfileStorage.TableId.PAGE_RESOURCE_ACCOUNTS_PANEL)); table.setOutputMarkupId(true); mainForm.add(table); initDialog(); }