Jeroen Hoffman pushed to branch master at cms-community / 
hippo-addon-hst-configuration-editor


Commits:
992ad2a7 by Jasper Floor at 2016-10-13T15:31:22+02:00
HSTCONFIGEDIT-204 for new sitemap items set the selected page design to the 
first item in the list - forward port of 203

(cherry picked from commit f070af49c8fa3c1a2eaa7693603d23d665c56e96)

- - - - -


1 changed file:

- 
frontend/src/main/java/org/hippoecm/hst/plugins/frontend/editor/description/DescriptionPicker.java


Changes:

=====================================
frontend/src/main/java/org/hippoecm/hst/plugins/frontend/editor/description/DescriptionPicker.java
=====================================
--- 
a/frontend/src/main/java/org/hippoecm/hst/plugins/frontend/editor/description/DescriptionPicker.java
+++ 
b/frontend/src/main/java/org/hippoecm/hst/plugins/frontend/editor/description/DescriptionPicker.java
@@ -272,14 +272,18 @@ public class DescriptionPicker extends Panel {
         current = 0;
         String selected = getDefaultModelObjectAsString();
         if (selected != null) {
-            int cnt = 0;
-            for (Descriptive descriptive : descriptives) {
-                final String name = getName(descriptive);
-                if (selected.equals(name)) {
-                    current = cnt;
-                    break;
+            if (StringUtils.isEmpty(selected)) {
+                setDefaultModelObjectByCurrentSelection();
+            } else {
+                int cnt = 0;
+                for (Descriptive descriptive : descriptives) {
+                    final String name = getName(descriptive);
+                    if (selected.equals(name)) {
+                        current = cnt;
+                        break;
+                    }
+                    cnt++;
                 }
-                cnt++;
             }
         }
     }



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-hst-configuration-editor/commit/992ad2a70989cf5c08532fd2c981a60c9b0785cf
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to