public LinksCollectionViewPanel(String id, IModel<ODocument> documentModel, OProperty property) { super(id, new DynamicPropertyValueModel<M>(documentModel, new OPropertyModel(property))); ISortableDataProvider<ODocument, String> provider = oClassIntrospector.prepareDataProviderForProperty(property, documentModel); List<IColumn<ODocument, String>> columns = new ArrayList<IColumn<ODocument,String>>(); columns.add(new OEntityColumn(property.getLinkedClass(), DisplayMode.VIEW.asModel())); GenericTablePanel<ODocument> tablePanel = new GenericTablePanel<ODocument>("tablePanel", columns, provider, 10); OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable(); table.getHeadersToolbar().setVisibilityAllowed(false); table.getNoRecordsToolbar().setVisibilityAllowed(false); add(tablePanel); }
@Override protected void onSubmit() { RequestCycle.get().find(AjaxRequestTarget.class).ifPresent(target -> { OQueryModel<K> filterState = getStateLocator().getFilterState(); OrienteerHeadersToolbar<K, String> headersToolbar = dataTable.getHeadersToolbar(); headersToolbar.clearFilteredColumns(); for (IColumn<K, String> column : GenericTablePanel.this.getDataTable().getColumns()) { if (column instanceof OPropertyValueColumn) { OPropertyValueColumn propertyValueColumn = (OPropertyValueColumn) column; OProperty property = propertyValueColumn.getCriteryModel().getObject(); if (property != null) { IFilterCriteriaManager manager = filterState.getFilterCriteriaManager(property.getName()); if (manager != null && manager.isFilterApply()) { headersToolbar.addFilteredColumn(property.getName()); } } } } target.add(dataTable); }); } };
GenericTablePanel<ODocument> tablePanel = new GenericTablePanel<>("links", columns, provider, 10); OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable(); table.getHeadersToolbar().setVisibilityAllowed(false); table.getNoRecordsToolbar().setVisibilityAllowed(false); table.addCommand(new SelectODocumentCommand(table, documentModel, new OPropertyModel(property))