From ada4f7d07853052c13eff340b6c98a96a3dc1ff1 Mon Sep 17 00:00:00 2001 From: Andi Huber Date: Thu, 21 Nov 2024 19:59:44 +0100 Subject: [PATCH] CAUSEWAY-2297: convert table models to java records (part 3) --- .../core/metamodel/tabular/DataColumn.java | 4 +- .../core/metamodel/tabular/DataRow.java | 2 +- .../tabular/DataTableInteractive.java | 10 +-- .../tabular/internal/DataColumnInternal.java | 4 +- .../tabular/internal/DataRowInternal.java | 4 +- .../tabular/internal/DataTableInternal.java | 82 ++++++++++--------- .../viewer/CalendaredCollectionAbstract.java | 2 +- .../wkt/ui/viewer/EventProviderAbstract.java | 2 +- .../util/interaction/DataTableTester.java | 18 ++-- .../interaction/coll/DataRowToggleWkt.java | 2 +- ...ollectionContentsSortableDataProvider.java | 2 +- .../icons/CollectionContentsAsIconsPanel.java | 2 +- .../summary/CollectionContentsAsSummary.java | 2 +- .../table/DataTableWithPagesAndFilter.java | 2 +- .../table/filter/FilterToolbar.java | 2 +- .../StandaloneCollectionPage.java | 2 +- 16 files changed, 75 insertions(+), 67 deletions(-) diff --git a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/DataColumn.java b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/DataColumn.java index d88a6373b99..609f99b330c 100644 --- a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/DataColumn.java +++ b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/DataColumn.java @@ -30,7 +30,7 @@ public interface DataColumn { */ String columnId(); ObjectAssociation associationMetaModel(); - Observable columnFriendlyName(); - Observable> columnDescription(); + Observable columnFriendlyNameObservable(); + Observable> columnDescriptionObservable(); } diff --git a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/DataRow.java b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/DataRow.java index ba4949f05ca..dae9925084f 100644 --- a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/DataRow.java +++ b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/DataRow.java @@ -37,7 +37,7 @@ public interface DataRow { /** * If the table supports row selection, represents the bindable row selection status for this {@link DataRow}. */ - Bindable selectToggle(); + Bindable selectToggleBindable(); Optional filterTokens(); diff --git a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/DataTableInteractive.java b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/DataTableInteractive.java index 6fa3060b10a..e12caf857cc 100644 --- a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/DataTableInteractive.java +++ b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/DataTableInteractive.java @@ -79,8 +79,8 @@ public Optional> asComparator(final Can titleObservable(); Observable> dataColumnsObservable(); - Observable> getDataElements(); - Observable> getDataRowsFilteredAndSorted(); + Observable> dataElementsObservable(); + Observable> dataRowsFilteredAndSortedObservable(); // -- META DATA @@ -94,7 +94,7 @@ public Optional> asComparator(final Can> asComparator(final Can getSelectedRowIndexes(); - Observable> getDataRowsSelected(); + Observable> dataRowsSelectedObservable(); void selectRangeOfRowsByIndex(IntStream range, boolean select); void selectAllFiltered(boolean select); void selectAll(boolean select); @@ -132,7 +132,7 @@ public Optional> asComparator(final Can getSearchArgument(); + Bindable searchArgumentBindable(); boolean isSearchSupported(); /** * @apiNote never called when not {@link #isSearchSupported()} diff --git a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataColumnInternal.java b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataColumnInternal.java index 7c5116e71b0..ee82c532d19 100644 --- a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataColumnInternal.java +++ b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataColumnInternal.java @@ -30,8 +30,8 @@ record DataColumnInternal( @NonNull String columnId, @NonNull ObjectAssociation associationMetaModel, - @NonNull LazyObservable columnFriendlyName, - @NonNull LazyObservable> columnDescription) + @NonNull LazyObservable columnFriendlyNameObservable, + @NonNull LazyObservable> columnDescriptionObservable) implements DataColumn { DataColumnInternal(final DataTableInternal parentTable, final ObjectAssociation associationMetaModel) { diff --git a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataRowInternal.java b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataRowInternal.java index 4c5e232da3b..6015026e615 100644 --- a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataRowInternal.java +++ b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataRowInternal.java @@ -39,7 +39,7 @@ record DataRowInternal( int rowIndex, ManagedObject rowElement, - BooleanBindable selectToggle, + BooleanBindable selectToggleBindable, DataTableInternal parentTable, Optional filterTokens ) implements DataRow { @@ -50,7 +50,7 @@ record DataRowInternal( final @NonNull ManagedObject rowElement, final @Nullable CollectionFilterService.Tokens filterTokens) { this(rowIndex, rowElement, _Bindables.forBoolean(false), parentTable, Optional.ofNullable(filterTokens)); - selectToggle.addListener((event, old, neW)->parentTable.handleRowSelectToggle()); + selectToggleBindable.addListener((event, old, neW)->parentTable.handleRowSelectToggle()); } @Override diff --git a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataTableInternal.java b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataTableInternal.java index c8c7ef5c7fb..64fadf3ccb7 100644 --- a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataTableInternal.java +++ b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataTableInternal.java @@ -104,12 +104,20 @@ public static DataTableInternal forAction( final @NonNull ManagedMember managedMember; final @NonNull Where where; - @Getter private final @NonNull LazyObservable> dataElements; - @Getter private final @NonNull _BindableAbstract searchArgument; // filter the data rows + @Accessors(fluent=true) + @Getter private final @NonNull LazyObservable> dataElementsObservable; + + @Accessors(fluent=true) + @Getter private final @NonNull _BindableAbstract searchArgumentBindable; // filter the data rows + + @Accessors(fluent=true) + @Getter private final @NonNull LazyObservable> dataRowsObservable; + + @Accessors(fluent=true) + @Getter private final @NonNull LazyObservable> dataRowsFilteredAndSortedObservable; - @Getter private final @NonNull LazyObservable> dataRows; - @Getter private final @NonNull LazyObservable> dataRowsFilteredAndSorted; - @Getter private final @NonNull LazyObservable> dataRowsSelected; + @Accessors(fluent=true) + @Getter private final @NonNull LazyObservable> dataRowsSelectedObservable; @Accessors(fluent=true) @Getter private final _BindableAbstract columnSortBinable; @@ -142,38 +150,38 @@ private DataTableInternal( this.where = where; this.filterHandler = _FilterUtils.createFilterHandler(elementType); - this.searchArgument = _Bindables.forValue(""); + this.searchArgumentBindable = _Bindables.forValue(""); this.columnSortBinable = _Bindables.forValue(null); - this.dataElements = _Observables.lazy(()->elements + this.dataElementsObservable = _Observables.lazy(()->elements //.map(mmc::injectServicesInto) // I believe is redundant, has major performance impact //.filter(this::ignoreHidden) // I believe is redundant, has major performance impact ); - this.dataRows = _Observables.lazy(()-> - dataElements.getValue().stream() + this.dataRowsObservable = _Observables.lazy(()-> + dataElementsObservable.getValue().stream() .map(IndexedFunction.zeroBased((rowIndex, element)->new DataRowInternal(rowIndex, this, element, tokens(element)))) .collect(Can.toCan())); - this.dataRowsFilteredAndSorted = _Observables.lazy(()-> + this.dataRowsFilteredAndSortedObservable = _Observables.lazy(()-> _Streams.sortConditionally( - dataRows.getValue().stream().filter(adaptSearchPredicate()), + dataRowsObservable.getValue().stream().filter(adaptSearchPredicate()), sortingComparator().orElse(null)) .collect(Can.toCan())); - this.dataRowsSelected = _Observables.lazy(()-> - dataRows.getValue().stream() - .filter(dataRow->dataRow.selectToggle().getValue().booleanValue()) + this.dataRowsSelectedObservable = _Observables.lazy(()-> + dataRowsObservable.getValue().stream() + .filter(dataRow->dataRow.selectToggleBindable().getValue().booleanValue()) .collect(Can.toCan())); this.selectionChanges = _Bindables.forValue(Boolean.FALSE); - this.searchArgument.addListener((e,o,n)->{ - dataRowsFilteredAndSorted.invalidate(); + this.searchArgumentBindable.addListener((e,o,n)->{ + dataRowsFilteredAndSortedObservable.invalidate(); }); this.columnSortBinable.addListener((e,o,n)->{ - dataRowsFilteredAndSorted.invalidate(); + dataRowsFilteredAndSortedObservable.invalidate(); }); this.dataColumnsObservable = _Observables.lazy(()-> @@ -208,7 +216,7 @@ public Optional getTableDecoratorIfAny() { * Count all data rows (the user is allowed to see). */ public int getVisibleElementCount() { - return dataElements.getValue().size(); + return dataElementsObservable.getValue().size(); } /** @@ -216,7 +224,7 @@ public int getVisibleElementCount() { */ @Override public int getFilteredElementCount() { - return dataRowsFilteredAndSorted.getValue().size(); + return dataRowsFilteredAndSortedObservable.getValue().size(); } @Override @@ -230,7 +238,7 @@ public ObjectSpecification getElementType() { @Override public Optional lookupDataRow(final int rowIndex) { - return getDataRows().getValue().get(rowIndex) + return dataRowsObservable().getValue().get(rowIndex) .map(DataRow.class::cast); } @@ -246,7 +254,7 @@ private Predicate adaptSearchPredicate() { return filterHandler.isEmpty() ? dataRow->true : dataRow->filterHandler.get().getDataRowFilter() - .test(dataRow, searchArgument.getValue()); + .test(dataRow, searchArgumentBindable.getValue()); } @Nullable @@ -288,7 +296,7 @@ void handleRowSelectToggle() { } private void invalidateSelectionThenNotifyListeners() { - dataRowsSelected.invalidate(); + dataRowsSelectedObservable.invalidate(); // simply toggles the boolean value, to trigger any listeners selectionChanges.setValue(!selectionChanges.getValue()); } @@ -296,9 +304,9 @@ private void invalidateSelectionThenNotifyListeners() { @Override public void selectAll(final boolean select) { doProgrammaticToggle(()->{ - dataRows.getValue() + dataRowsObservable.getValue() .forEach(dataRow->{ - dataRow.selectToggle().setValue(select); + dataRow.selectToggleBindable().setValue(select); }); }); } @@ -306,9 +314,9 @@ public void selectAll(final boolean select) { @Override public void selectAllFiltered(final boolean select) { doProgrammaticToggle(()->{ - dataRowsFilteredAndSorted.getValue() + dataRowsFilteredAndSortedObservable.getValue() .forEach(dataRow->{ - dataRow.selectToggle().setValue(select); + dataRow.selectToggleBindable().setValue(select); }); }); } @@ -316,10 +324,10 @@ public void selectAllFiltered(final boolean select) { @Override public void selectRangeOfRowsByIndex(final IntStream range, final boolean select) { doProgrammaticToggle(()->{ - dataRowsFilteredAndSorted.getValue() + dataRowsFilteredAndSortedObservable.getValue() .pickByIndex(range) .forEach(dataRow->{ - dataRow.selectToggle().setValue(select); + dataRow.selectToggleBindable().setValue(select); }); }); } @@ -343,13 +351,13 @@ public void selectRangeOfRowsByIndex(final IntStream range, final boolean select @Override public Can getSelected() { - return dataRowsSelected.getValue() + return dataRowsSelectedObservable.getValue() .map(DataRow::rowElement); } @Override public Set getSelectedRowIndexes() { - return dataRowsSelected.getValue() + return dataRowsSelectedObservable.getValue() .stream() .map(DataRow::rowIndex) .collect(Collectors.toSet()); @@ -377,7 +385,7 @@ public DataTable export() { titleObservable().getValue(), dataColumnsObservable().getValue() .map(DataColumn::associationMetaModel), - getDataRowsFilteredAndSorted().getValue() + dataRowsFilteredAndSortedObservable().getValue() .stream() .map(dr->dr.rowElement()) .collect(Can.toCan())); @@ -390,7 +398,7 @@ private DataTable exportAll() { titleObservable().getValue(), dataColumnsObservable().getValue() .map(DataColumn::associationMetaModel), - getDataElements().getValue()); + dataElementsObservable().getValue()); } // -- MEMENTO @@ -420,7 +428,7 @@ static Memento create( tableInteractive.managedMember.getIdentifier(), tableInteractive.where, tableInteractive.exportAll(), - tableInteractive.searchArgument.getValue(), + tableInteractive.searchArgumentBindable.getValue(), tableInteractive.getSelectedRowIndexes(), tableInteractive.columnSortBinable().getValue()); } @@ -462,18 +470,18 @@ public DataTableInternal getDataTableModel(final ManagedObject owner) { if(columnSort!=null) { dataTableInteractive.columnSortBinable.setValue(columnSort); } - dataTableInteractive.searchArgument.setValue(searchArgument); + dataTableInteractive.searchArgumentBindable.setValue(searchArgument); dataTableInteractive.doProgrammaticToggle(()->{ - dataTableInteractive.dataRows.getValue().stream() + dataTableInteractive.dataRowsObservable.getValue().stream() .filter(dataRow->selectedRowIndexes.contains(dataRow.rowIndex())) - .forEach(dataRow->dataRow.selectToggle().setValue(true)); + .forEach(dataRow->dataRow.selectToggleBindable().setValue(true)); }); return dataTableInteractive; } @Override public void setupBindings(final DataTableInteractive tableInteractive) { - tableInteractive.getSearchArgument().addListener((e, o, searchArg)->{ + tableInteractive.searchArgumentBindable().addListener((e, o, searchArg)->{ this.searchArgument = searchArg; }); ((DataTableInternal)tableInteractive).selectionChanges.addListener((e, o, n)->{ diff --git a/extensions/vw/fullcalendar/wicket/ui/src/main/java/org/apache/causeway/extensions/fullcalendar/wkt/ui/viewer/CalendaredCollectionAbstract.java b/extensions/vw/fullcalendar/wicket/ui/src/main/java/org/apache/causeway/extensions/fullcalendar/wkt/ui/viewer/CalendaredCollectionAbstract.java index 21a94418d4a..677e1f585d2 100644 --- a/extensions/vw/fullcalendar/wicket/ui/src/main/java/org/apache/causeway/extensions/fullcalendar/wkt/ui/viewer/CalendaredCollectionAbstract.java +++ b/extensions/vw/fullcalendar/wicket/ui/src/main/java/org/apache/causeway/extensions/fullcalendar/wkt/ui/viewer/CalendaredCollectionAbstract.java @@ -79,7 +79,7 @@ private void buildGui() { config.setSelectable(true); config.setAllDaySlot(true); - final Iterable entityList = model.getDataTableModel().getDataRowsFilteredAndSorted().getValue() + final Iterable entityList = model.getDataTableModel().dataRowsFilteredAndSortedObservable().getValue() .map(DataRow::rowElement); final Iterable calendarNames = getCalendarNames(entityList); diff --git a/extensions/vw/fullcalendar/wicket/ui/src/main/java/org/apache/causeway/extensions/fullcalendar/wkt/ui/viewer/EventProviderAbstract.java b/extensions/vw/fullcalendar/wicket/ui/src/main/java/org/apache/causeway/extensions/fullcalendar/wkt/ui/viewer/EventProviderAbstract.java index b375c066b7a..0d39eb9b22b 100644 --- a/extensions/vw/fullcalendar/wicket/ui/src/main/java/org/apache/causeway/extensions/fullcalendar/wkt/ui/viewer/EventProviderAbstract.java +++ b/extensions/vw/fullcalendar/wicket/ui/src/main/java/org/apache/causeway/extensions/fullcalendar/wkt/ui/viewer/EventProviderAbstract.java @@ -51,7 +51,7 @@ public EventProviderAbstract(final EntityCollectionModel collectionModel, final var commonContext = collectionModel.getMetaModelContext(); collectionModel.getDataTableModel() - .getDataElements().getValue() + .dataElementsObservable().getValue() .stream() .map(newEvent(commonContext, calendarName)) .filter(Objects::nonNull) diff --git a/regressiontests/base/src/main/java/org/apache/causeway/testdomain/util/interaction/DataTableTester.java b/regressiontests/base/src/main/java/org/apache/causeway/testdomain/util/interaction/DataTableTester.java index f3a5793be43..f7d9f0f0968 100644 --- a/regressiontests/base/src/main/java/org/apache/causeway/testdomain/util/interaction/DataTableTester.java +++ b/regressiontests/base/src/main/java/org/apache/causeway/testdomain/util/interaction/DataTableTester.java @@ -40,20 +40,20 @@ public class DataTableTester { public void assertUnfilteredDataElements(final List expectedPojoElements) { assertEquals(expectedPojoElements, - dataTable.getDataElements().getValue() + dataTable.dataElementsObservable().getValue() .map(MmUnwrapUtils::single).toList()); } public void assertFilteredDataElements(final List expectedPojoElements) { assertEquals(expectedPojoElements, - dataTable.getDataRowsFilteredAndSorted().getValue() + dataTable.dataRowsFilteredAndSortedObservable().getValue() .map(DataRow::rowElement) .map(MmUnwrapUtils::single).toList()); } public void assertSelectedDataElements(final List expectedPojoElements) { assertEquals(expectedPojoElements, - dataTable.getDataRowsSelected().getValue() + dataTable.dataRowsSelectedObservable().getValue() .map(DataRow::rowElement) .map(MmUnwrapUtils::single).toList()); } @@ -62,7 +62,7 @@ public void assertDataRowSelectionWhenToggledOn( final List toggleOnIndices, final List expectedPojoElements) { toggleOnIndices.forEach(index-> - dataTable.getDataRowsFilteredAndSorted().getValue().getElseFail(index).selectToggle().setValue(true)); + dataTable.dataRowsFilteredAndSortedObservable().getValue().getElseFail(index).selectToggleBindable().setValue(true)); assertSelectedDataElements(expectedPojoElements); } @@ -70,28 +70,28 @@ public void assertDataRowSelectionWhenToggledOff( final List toggleOffIndices, final List expectedPojoElements) { toggleOffIndices.forEach(index-> - dataTable.getDataRowsFilteredAndSorted().getValue().getElseFail(index).selectToggle().setValue(false)); + dataTable.dataRowsFilteredAndSortedObservable().getValue().getElseFail(index).selectToggleBindable().setValue(false)); assertSelectedDataElements(expectedPojoElements); } public void assertDataRowSelectionIsAll() { assertEquals( - dataTable.getDataRowsFilteredAndSorted().getValue() + dataTable.dataRowsFilteredAndSortedObservable().getValue() .map(DataRow::rowElement) .map(MmUnwrapUtils::single).toList(), - dataTable.getDataRowsSelected().getValue() + dataTable.dataRowsSelectedObservable().getValue() .map(DataRow::rowElement) .map(MmUnwrapUtils::single).toList()); } public void assertDataRowSelectionIsEmpty() { - assertEquals(0, dataTable.getDataRowsSelected().getValue().size()); + assertEquals(0, dataTable.dataRowsSelectedObservable().getValue().size()); } public void assertColumnNames(final List expectedColumnNames) { assertEquals(expectedColumnNames, dataTable.dataColumnsObservable().getValue().stream() - .map(DataColumn::columnFriendlyName) + .map(DataColumn::columnFriendlyNameObservable) .map(Observable::getValue) .collect(Collectors.toList())); } diff --git a/viewers/wicket/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/interaction/coll/DataRowToggleWkt.java b/viewers/wicket/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/interaction/coll/DataRowToggleWkt.java index a03c097d447..def78952375 100644 --- a/viewers/wicket/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/interaction/coll/DataRowToggleWkt.java +++ b/viewers/wicket/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/interaction/coll/DataRowToggleWkt.java @@ -46,7 +46,7 @@ public DataRowToggleWkt(final DataRowWkt dataRowWkt) { protected Optional> getBindable( final @Nullable DataRow dataRow) { return dataRow!=null - ? Optional.ofNullable(dataRow.selectToggle()) + ? Optional.ofNullable(dataRow.selectToggleBindable()) : Optional.empty(); } diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsSortableDataProvider.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsSortableDataProvider.java index 2ea47c09d7c..d1eea194da8 100644 --- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsSortableDataProvider.java +++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/collectioncontents/ajaxtable/CollectionContentsSortableDataProvider.java @@ -80,7 +80,7 @@ public long size() { @Override public Iterator iterator(final long skip, final long limit) { var dataTable = getDataTableModel(); - return dataTable.getDataRowsFilteredAndSorted().getValue() + return dataTable.dataRowsFilteredAndSortedObservable().getValue() .iterator(Math.toIntExact(skip), Math.toIntExact(limit)); } diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/collectioncontents/icons/CollectionContentsAsIconsPanel.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/collectioncontents/icons/CollectionContentsAsIconsPanel.java index 8206312074f..9c78e018f7b 100644 --- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/collectioncontents/icons/CollectionContentsAsIconsPanel.java +++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/collectioncontents/icons/CollectionContentsAsIconsPanel.java @@ -46,7 +46,7 @@ public CollectionContentsAsIconsPanel(final String id, final EntityCollectionMod private void buildGui() { final EntityCollectionModel model = getModel(); - var visibleAdapters = model.getDataTableModel().getDataRowsFilteredAndSorted() + var visibleAdapters = model.getDataTableModel().dataRowsFilteredAndSortedObservable() .getValue() .map(DataRow::rowElement) .toList(); diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/collectioncontents/summary/CollectionContentsAsSummary.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/collectioncontents/summary/CollectionContentsAsSummary.java index 01292e0c4e5..996e25ed6ef 100644 --- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/collectioncontents/summary/CollectionContentsAsSummary.java +++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/collectioncontents/summary/CollectionContentsAsSummary.java @@ -102,7 +102,7 @@ private void buildGui() { var propertyColumnName = numberAssociation.getCanonicalFriendlyName(); Wkt.labelAdd(item, ID_PROPERTY_NAME, propertyColumnName); - var visibleAdapters = model.getDataTableModel().getDataRowsFilteredAndSorted() + var visibleAdapters = model.getDataTableModel().dataRowsFilteredAndSortedObservable() .getValue() .map(DataRow::rowElement) .toList(); diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/table/DataTableWithPagesAndFilter.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/table/DataTableWithPagesAndFilter.java index 024b4391144..9fe21783a8a 100644 --- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/table/DataTableWithPagesAndFilter.java +++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/table/DataTableWithPagesAndFilter.java @@ -124,7 +124,7 @@ public void setSearchArg(final String value) { if(_Strings.nullToEmpty(this.searchArg).equals(_Strings.nullToEmpty(value))) return; this.searchArg = value; // update the interactive model - _TableUtils.interactive(this).getSearchArgument().setValue(searchArg); + _TableUtils.interactive(this).searchArgumentBindable().setValue(searchArg); } // -- PAGESIZE diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/table/filter/FilterToolbar.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/table/filter/FilterToolbar.java index b18472f2710..7a8f9bafc26 100644 --- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/table/filter/FilterToolbar.java +++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/table/filter/FilterToolbar.java @@ -63,7 +63,7 @@ protected void onConfigure() { private void buildGui() { var dataTableInteractive = _TableUtils.interactive(table); - var searchField = new TextField<>(ID_TABLE_SEARCH_INPUT, Model.of(dataTableInteractive.getSearchArgument().getValue())); + var searchField = new TextField<>(ID_TABLE_SEARCH_INPUT, Model.of(dataTableInteractive.searchArgumentBindable().getValue())); Wkt.attributeReplace(searchField, "placeholder", dataTableInteractive.getSearchPromptPlaceholderText()); Wkt.linkAdd(this, ID_TABLE_SEARCH_BUTTON, target->{ diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/standalonecollection/StandaloneCollectionPage.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/standalonecollection/StandaloneCollectionPage.java index e7853a1d737..09df49dcc54 100644 --- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/standalonecollection/StandaloneCollectionPage.java +++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/standalonecollection/StandaloneCollectionPage.java @@ -88,7 +88,7 @@ private void onRenderingOrRendered( Supplier> listSupplier = () -> { final var dataTableInteractive = collectionModel.getObject(); - Observable> dataElements = dataTableInteractive.getDataElements(); + Observable> dataElements = dataTableInteractive.dataElementsObservable(); Can managedObjects = dataElements.getValue(); final var bookmarks =