ref #6554 Fix initial expansion state
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 17 Oct 2018 09:37:31 +0000 (11:37 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 17 Oct 2018 09:37:31 +0000 (11:37 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/CdmSectionPart.java

index 7381ae86c6b3eafa596babe59c827f03bee6f338..66d0f4e07a7f4d4ecd1566c6663a0a55d236c608 100644 (file)
@@ -57,6 +57,11 @@ public class CdmSectionPart<T> extends SectionPart implements
 
        private final AbstractFormSection<T> formSection;
 
+       /**
+        * Initial input
+        */
+       private Object rootInput;
+
        /**
         * <p>
         * Constructor for CdmSectionPart.
@@ -76,6 +81,7 @@ public class CdmSectionPart<T> extends SectionPart implements
        /** {@inheritDoc} */
        @Override
        public boolean setFormInput(Object input) {
+           this.rootInput = input;
            //FIXME (CM): Need to fix this part of the design.
            //The design seems to be locked to the idea that only one
            // entity (either from the navigator or the editor) drives
@@ -193,7 +199,7 @@ public class CdmSectionPart<T> extends SectionPart implements
        @Override
        protected void expansionStateChanged(boolean expanded) {
            super.expansionStateChanged(expanded);
-           PreferencesUtil.getPreferenceStore().setValue(StoreUtil.getPrefKey(formSection.getClass(), formSection.getEntity()), expanded);
+           PreferencesUtil.getPreferenceStore().setValue(StoreUtil.getPrefKey(formSection.getClass(), rootInput), expanded);
        }
 
 }