You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2006/10/11 05:50:02 UTC

svn commit: r462685 - in /cocoon: branches/BRANCH_2_1_X/status.xml trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/Tree.java

Author: antonio
Date: Tue Oct 10 20:50:01 2006
New Revision: 462685

URL: http://svn.apache.org/viewvc?view=rev&rev=462685
Log:

<action dev="AG" type="fix" fixes-bug="COCOON-1692" due-to="Suzan Foster" due-to-email="suzan.foster@nerocmediaware.nl">
  Cforms: Tree widget not handling on-selection-change events correctly.
</action>

Modified:
    cocoon/branches/BRANCH_2_1_X/status.xml
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/Tree.java

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/status.xml?view=diff&rev=462685&r1=462684&r2=462685
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Tue Oct 10 20:50:01 2006
@@ -184,6 +184,9 @@
   <release version="@version@" date="@date@">
 -->
   <release version="2.1.10" date="TBD">
+    <action dev="AG" type="fix" fixes-bug="COCOON-1692" due-to="Suzan Foster" due-to-email="suzan.foster@nerocmediaware.nl">
+      Cforms: Tree widget not handling on-selection-change events correctly.
+    </action>
     <action dev="JH" type="fix" fixes-bug="COCOON-1883" due-to="Fabian Linz" due-to-email="f.linz@gmx.de">
       XSP: SOAPHelper does no longer accept only replies with an XML declaration.
     </action>

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/Tree.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/Tree.java?view=diff&rev=462685&r1=462684&r2=462685
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/Tree.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/Tree.java Tue Oct 10 20:50:01 2006
@@ -24,6 +24,7 @@
 
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.forms.FormContext;
+import org.apache.cocoon.forms.event.WidgetEvent;
 import org.apache.cocoon.forms.event.WidgetEventMulticaster;
 import org.apache.cocoon.forms.formmodel.AbstractWidget;
 import org.apache.cocoon.forms.formmodel.Widget;
@@ -260,9 +261,7 @@
             if (this.expandSelectedPath) {
                 expandPath(path);
             }
-            if (this.selectionListener != null) {
-                this.selectionListener.selectionChanged(new TreeSelectionEvent(this, path, true));
-            }
+            this.getForm().addWidgetEvent(new TreeSelectionEvent(this, path, true));
         }
     }
 
@@ -281,9 +280,7 @@
         if (this.selectedPaths.remove(path)) {
             // Need to redisplay the parent
             markForRefresh(path.getParentPath());
-            if (this.selectionListener != null) {
-                this.selectionListener.selectionChanged(new TreeSelectionEvent(this, path, false));
-            }
+            this.getForm().addWidgetEvent(new TreeSelectionEvent(this, path, false));
         }
     }
 
@@ -305,9 +302,7 @@
             markForRefresh(paths[i].getParentPath());
         }
         this.selectedPaths.clear();
-        if (this.selectionListener != null) {
-            this.selectionListener.selectionChanged(new TreeSelectionEvent(this, paths, false));
-        }
+        this.getForm().addWidgetEvent(new TreeSelectionEvent(this, paths, false));
     }
 
     public void addTreeSelectionListener(TreeSelectionListener listener) {
@@ -426,6 +421,15 @@
         return null;
     }
 
+    public void broadcastEvent(WidgetEvent event) {
+       if (event instanceof TreeSelectionEvent) {
+           if (this.selectionListener != null) {
+               this.selectionListener.selectionChanged((TreeSelectionEvent)event);
+           }
+       } else {
+           super.broadcastEvent(event);
+       }
+   }
     //---------------------------------------------------------------------------------------------
     // TreeNode widget, which is the actual parent of widgets contained in a node
     //---------------------------------------------------------------------------------------------