From 9e7087a20a8bbdac248a2a6261212edc94501675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Judilson=20Jos=C3=A9=20da=20Costa=20J=C3=BAnior?= Date: Mon, 18 Jun 2018 10:25:50 -0300 Subject: [PATCH] fixed #226 Redundant property columns in parent-child level with show --- .../org/pivot4j/ui/table/TableHeaderNode.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pivot4j-core/src/main/java/org/pivot4j/ui/table/TableHeaderNode.java b/pivot4j-core/src/main/java/org/pivot4j/ui/table/TableHeaderNode.java index 4a50abfa..446528a9 100644 --- a/pivot4j-core/src/main/java/org/pivot4j/ui/table/TableHeaderNode.java +++ b/pivot4j-core/src/main/java/org/pivot4j/ui/table/TableHeaderNode.java @@ -248,7 +248,9 @@ void addMemberProperties() { List> children = null; - if (getMember() != null) { + // Should render level properties only once behind the latest + if (getMember() != null && isLastInLevel()) { + List levels = getReference().getLevels(getHierarchy()); boolean showParent = getReference().getRenderer().getShowParentMembers(); @@ -315,6 +317,18 @@ void addMemberProperties() { } } + private boolean isLastInLevel() { + if (getChildCount() == 0) { + return true; + } + + TableHeaderNode childNode = (TableHeaderNode) getChildren().get(0); + if (getMember().getLevel().getDepth() == childNode.getMember().getLevel().getDepth()) { + return !OlapUtils.equals(getHierarchy(), childNode.getHierarchy()); + } + return true; + } + void mergeChildren() { List> children = new ArrayList>(getChildren());