You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2017/09/14 17:46:30 UTC

[08/13] isis git commit: Fix ISIS-1698 CollectionLayout.defaultView not honored

Fix ISIS-1698 CollectionLayout.defaultView not honored

Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/25c3f8e3
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/25c3f8e3
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/25c3f8e3

Branch: refs/heads/master
Commit: 25c3f8e357f090d09d4592b4d68a3afbe850ae75
Parents: 1b60ce1
Author: hobrom <ho...@gmx.at>
Authored: Tue Sep 12 21:58:51 2017 +0200
Committer: hobrom <ho...@gmx.at>
Committed: Tue Sep 12 21:58:51 2017 +0200

----------------------------------------------------------------------
 .../isis/viewer/wicket/ui/components/layout/bs3/col/Col.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/25c3f8e3/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/bs3/col/Col.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/bs3/col/Col.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/bs3/col/Col.java
index 11dbd06..0770f66 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/bs3/col/Col.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/bs3/col/Col.java
@@ -263,12 +263,14 @@ public class Col extends PanelAbstract<EntityModel> implements HasDynamicallyVis
             final RepeatingViewWithDynamicallyVisibleContent collectionRv =
                     new RepeatingViewWithDynamicallyVisibleContent(ID_COLLECTIONS);
 
+            final EntityModel entityModel = getModel();
+            final CollectionLayoutData snapshot = entityModel.getCollectionLayoutData();
+            
             for (CollectionLayoutData collection : collections) {
 
                 final String id = collectionRv.newChildId();
 
                 // we successively trample over the layout data; but that's ok, this is synchronous code anyway...
-                final EntityModel entityModel = getModel();
                 entityModel.setCollectionLayoutData(collection);
 
                 // the entityModel's getLayoutData() provides the hint as to which collection of the entity to render.
@@ -280,6 +282,10 @@ public class Col extends PanelAbstract<EntityModel> implements HasDynamicallyVis
             }
             div.add(collectionRv);
             visible = visible || collectionRv.isVisible();
+            
+            //XXX ISIS-1698 restore original state after trampling over
+            entityModel.setCollectionLayoutData(snapshot);
+            
         } else {
             Components.permanentlyHide(div, ID_COLLECTIONS);
         }