This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch pre-merge
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit f09ba002c27d661603af44aabf742a082a474497
Merge: 909f292f86 7b8fdc1478
Author: Dan Haywood <[email protected]>
AuthorDate: Tue Jul 9 06:05:47 2024 +0100

    Merge branch 'maintenance-branch' into pre-merge

 .../metamodel/tabular/internal/DataRowInternal.java    | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --cc 
core/metamodel/src/main/java/org/apache/causeway/core/metamodel/tabular/internal/DataRowInternal.java
index de7e55a791,364581e8bf..5346e177f2
--- 
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
@@@ -16,13 -16,12 +16,17 @@@
   *  specific language governing permissions and limitations
   *  under the License.
   */
 -package org.apache.causeway.core.metamodel.tabular.interactive;
 +package org.apache.causeway.core.metamodel.tabular.internal;
  
  import java.util.Optional;
 -import java.util.UUID;
  
+ import org.apache.causeway.applib.annotation.Where;
++
++import org.apache.causeway.core.metamodel.consent.InteractionInitiatedBy;
++
 +import org.springframework.lang.Nullable;
 +
 +import org.apache.causeway.applib.services.filter.CollectionFilterService;
  import org.apache.causeway.commons.collections.Can;
  import org.apache.causeway.commons.internal.binding._Bindables;
  import 
org.apache.causeway.commons.internal.binding._Bindables.BooleanBindable;
@@@ -34,22 -32,17 +38,23 @@@ import org.apache.causeway.core.metamod
  
  import lombok.Getter;
  import lombok.NonNull;
++import lombok.val;
  
 -public class DataRow {
 +class DataRowInternal
 +implements DataRow {
  
 -    @Getter private final UUID uuid = UUID.randomUUID(); // in support of 
client side sorting
 +    @Getter private final int rowIndex;
      private final ManagedObject rowElement;
      @Getter private final BooleanBindable selectToggle;
 -    @Getter private final DataTableInteractive parentTable;
 +    @Getter private final DataTableInternal parentTable;
 +    @Getter final Optional<CollectionFilterService.Tokens> filterTokens;
  
 -    public DataRow(
 -            final @NonNull DataTableInteractive parentTable,
 -            final @NonNull ManagedObject rowElement) {
 +    DataRowInternal(
 +            final int rowIndex,
 +            final @NonNull DataTableInternal parentTable,
 +            final @NonNull ManagedObject rowElement,
 +            final @Nullable CollectionFilterService.Tokens filterTokens) {
 +        this.rowIndex = rowIndex;
          this.parentTable = parentTable;
          this.rowElement = rowElement;
  
@@@ -76,12 -74,19 +81,21 @@@
      /**
       * Can be none, one or many per table cell.
       */
 +    @Override
      public Can<ManagedObject> getCellElementsForColumn(final @NonNull 
DataColumn column) {
          final ObjectAssociation assoc = column.getAssociationMetaModel();
++        val interactionInitiatedBy = InteractionInitiatedBy.PASS_THROUGH;
          return assoc.getSpecialization().fold(
-                 property->Can.of(property.get(getRowElement())),
-                 
collection->ManagedObjects.unpack(collection.get(getRowElement())));
+                 property-> Can.of(
+                         // similar to ManagedProperty#reassessPropertyValue
 -                        property.isVisible(getRowElement(), 
InteractionInitiatedBy.PASS_THROUGH, Where.ALL_TABLES).isAllowed()
 -                                ? property.get(getRowElement(), 
InteractionInitiatedBy.PASS_THROUGH)
++                        property.isVisible(getRowElement(), 
interactionInitiatedBy, Where.ALL_TABLES).isAllowed()
++                                ? property.get(getRowElement(), 
interactionInitiatedBy)
+                                 : 
ManagedObject.empty(property.getElementType())),
+                 collection-> ManagedObjects.unpack(
 -                        collection.isVisible(getRowElement(), 
InteractionInitiatedBy.PASS_THROUGH, Where.ALL_TABLES).isAllowed()
 -                                ? collection.get(getRowElement(), 
InteractionInitiatedBy.PASS_THROUGH)
++                        collection.isVisible(getRowElement(), 
interactionInitiatedBy, Where.ALL_TABLES).isAllowed()
++                                ? collection.get(getRowElement(), 
interactionInitiatedBy)
+                                 : null
+                 ));
      }
  
      /**

Reply via email to