myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bom...@apache.org
Subject svn commit: r1066647 - in /myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component: AbstractUIMediator.java AbstractUISheet.java AbstractUITabGroup.java AbstractUITreeNode.java
Date Wed, 02 Feb 2011 21:56:53 GMT
Author: bommel
Date: Wed Feb  2 21:56:53 2011
New Revision: 1066647

URL: http://svn.apache.org/viewvc?rev=1066647&view=rev
Log:
(TOBAGO-970) Changes in broadcast method should be performed after all listener are called

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIMediator.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITreeNode.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIMediator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIMediator.java?rev=1066647&r1=1066646&r2=1066647&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIMediator.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIMediator.java
Wed Feb  2 21:56:53 2011
@@ -25,6 +25,7 @@ import javax.faces.context.FacesContext;
 import javax.faces.event.AbortProcessingException;
 import javax.faces.event.FacesEvent;
 import java.io.IOException;
+import java.util.Map;
 
 public abstract class AbstractUIMediator extends AbstractUIPanelBase implements LayoutComponent
{
 
@@ -50,10 +51,13 @@ public abstract class AbstractUIMediator
 
   @Override
   public void broadcast(FacesEvent event) throws AbortProcessingException {
-    FacesContext facesContext = FacesContext.getCurrentInstance();
-    facesContext.getExternalContext().getRequestMap().put(var, this);
-    super.broadcast(event);
-    facesContext.getExternalContext().getRequestMap().remove(var);
+    Map requestMap = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
+    requestMap.put(var, this);
+    try {
+      super.broadcast(event);
+    } finally {
+      requestMap.remove(var);
+    }
   }
 
   @Override

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java?rev=1066647&r1=1066646&r2=1066647&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
Wed Feb  2 21:56:53 2011
@@ -334,16 +334,17 @@ public abstract class AbstractUISheet ex
       FacesUtils.invokeMethodBinding(getFacesContext(), getStateChangeListener(), facesEvent);
     } else if (facesEvent instanceof PageActionEvent) {
       if (facesEvent.getComponent() == this) {
-        performPaging((PageActionEvent) facesEvent);
         FacesUtils.invokeMethodBinding(
             getFacesContext(), getStateChangeListener(), new SheetStateChangeEvent(this));
+        performPaging((PageActionEvent) facesEvent);
       }
     } else if (facesEvent instanceof SortActionEvent) {
-      getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
       MethodBinding methodBinding = getSortActionListener();
       if (methodBinding!= null) {
         FacesUtils.invokeMethodBinding(getFacesContext(), methodBinding, facesEvent);
+        getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
       } else {
+        getSheetState(getFacesContext()).updateSortState((SortActionEvent) facesEvent);
         new Sorter().perform((SortActionEvent) facesEvent);
       }
     }

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java?rev=1066647&r1=1066646&r2=1066647&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITabGroup.java
Wed Feb  2 21:56:53 2011
@@ -196,13 +196,6 @@ public abstract class AbstractUITabGroup
   public void broadcast(FacesEvent facesEvent) throws AbortProcessingException {
     super.broadcast(facesEvent);
     if (facesEvent instanceof TabChangeEvent && facesEvent.getComponent() == this)
{
-      Integer index = ((TabChangeEvent) facesEvent).getNewTabIndex();
-      if (FacesUtils.hasValueBindingOrValueExpression(this, Attributes.SELECTED_INDEX)) {
-        FacesUtils.setValueOfBindingOrExpression(getFacesContext(), index, this, Attributes.SELECTED_INDEX);
-      } else {
-        setSelectedIndex(index);
-      }
-
       FacesUtils.invokeMethodBinding(getFacesContext(), getTabChangeListener(), facesEvent);
 
       FacesUtils.invokeMethodBinding(getFacesContext(), getActionListener(), facesEvent);
@@ -211,6 +204,12 @@ public abstract class AbstractUITabGroup
       if (defaultActionListener != null) {
         defaultActionListener.processAction((ActionEvent) facesEvent);
       }
+      Integer index = ((TabChangeEvent) facesEvent).getNewTabIndex();
+      if (FacesUtils.hasValueBindingOrValueExpression(this, Attributes.SELECTED_INDEX)) {
+        FacesUtils.setValueOfBindingOrExpression(getFacesContext(), index, this, Attributes.SELECTED_INDEX);
+      } else {
+        setSelectedIndex(index);
+      }
     }
   }
 

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITreeNode.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITreeNode.java?rev=1066647&r1=1066646&r2=1066647&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITreeNode.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUITreeNode.java
Wed Feb  2 21:56:53 2011
@@ -198,7 +198,7 @@ public abstract class AbstractUITreeNode
   public void broadcast(FacesEvent event) throws AbortProcessingException {
     super.broadcast(event);
     if (event instanceof TreeExpansionEvent) {
-
+      FacesUtils.invokeMethodBinding(getFacesContext(), getTreeExpansionListener(), event);
       boolean expanded = ((TreeExpansionEvent) event).isNewExpanded();
 
       if (FacesUtils.hasValueBindingOrValueExpression(this, Attributes.EXPANDED)) {
@@ -206,8 +206,6 @@ public abstract class AbstractUITreeNode
       } else {
         setExpanded(expanded);
       }
-
-      FacesUtils.invokeMethodBinding(getFacesContext(), getTreeExpansionListener(), event);
     }
   }
 



Mime
View raw message