Jeroen Hoffman pushed to branch release/4.0 at cms-community / hippo-cms

Commits:
e044f428 by Jeroen Hoffman at 2016-07-20T12:49:24+02:00
CMS-10225 [Back port to 11.0] Image upload select doesn't pick up the right 
imageset

(cherry picked from commit caa7ff3750bffa9bfceb1cf5958640998da86e8c)
(cherry picked from commit 5e49e1ee0351a147bdfdf261c50ffbabe8c89cf3)

- - - - -


1 changed file:

- 
gallery/frontend/src/main/java/org/hippoecm/frontend/plugins/gallery/GalleryWorkflowPlugin.java


Changes:

=====================================
gallery/frontend/src/main/java/org/hippoecm/frontend/plugins/gallery/GalleryWorkflowPlugin.java
=====================================
--- 
a/gallery/frontend/src/main/java/org/hippoecm/frontend/plugins/gallery/GalleryWorkflowPlugin.java
+++ 
b/gallery/frontend/src/main/java/org/hippoecm/frontend/plugins/gallery/GalleryWorkflowPlugin.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2009-2015 Hippo B.V. (http://www.onehippo.com)
+ *  Copyright 2009-2016 Hippo B.V. (http://www.onehippo.com)
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -25,6 +25,8 @@ import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
 import org.apache.wicket.Component;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.form.DropDownChoice;
 import org.apache.wicket.markup.html.form.upload.FileUpload;
@@ -242,6 +244,12 @@ public class GalleryWorkflowPlugin extends 
CompatibilityWorkflowPlugin<GalleryWo
             type = galleryTypes.get(0);
             typeComponent = new DropDownChoice<>("type", new 
PropertyModel<>(this, "type"), galleryTypes,
                     new 
TypeChoiceRenderer(this)).setNullValid(false).setRequired(true);
+            // needed to keep dropdown selection:
+            typeComponent.add(new 
AjaxFormComponentUpdatingBehavior("onchange") {
+                @Override
+                protected void onUpdate(AjaxRequestTarget art) {
+                }
+            });
         } else if (galleryTypes != null && galleryTypes.size() == 1) {
             type = galleryTypes.get(0);
             typeComponent = new Label("type", type).setVisible(false);



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-cms/commit/e044f428ceda82d4f09d0c276762f23687e486a3
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to