You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ja...@apache.org on 2010/05/13 21:19:27 UTC

svn commit: r943981 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java

Author: jakobk
Date: Thu May 13 19:19:26 2010
New Revision: 943981

URL: http://svn.apache.org/viewvc?rev=943981&view=rev
Log:
MYFACES-2713 UIRepeat.broadcast() has to push the component of the IndexedEvent target to the stack

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java?rev=943981&r1=943980&r2=943981&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java Thu May 13 19:19:26 2010
@@ -1028,8 +1028,37 @@ public class UIRepeat extends UIComponen
                 _setIndex(idxEvent.getIndex());
                 if (_isIndexAvailable())
                 {
+                    // get the target FacesEvent
                     FacesEvent target = idxEvent.getTarget();
-                    target.getComponent().broadcast(target);
+                    FacesContext facesContext = getFacesContext();
+                    
+                    // get the component associated with the target event and push
+                    // it and its composite component parent, if available, to the
+                    // component stack to have them available while processing the 
+                    // event (see also UIViewRoot._broadcastAll()).
+                    UIComponent targetComponent = target.getComponent();
+                    UIComponent compositeParent = UIComponent
+                            .getCompositeComponentParent(targetComponent);
+                    if (compositeParent != null)
+                    {
+                        pushComponentToEL(facesContext, compositeParent);
+                    }
+                    pushComponentToEL(facesContext, targetComponent);
+                    
+                    try
+                    {
+                        // actual event broadcasting
+                        targetComponent.broadcast(target);
+                    }
+                    finally
+                    {
+                        // remove the components from the stack again
+                        popComponentFromEL(facesContext);
+                        if (compositeParent != null)
+                        {
+                            popComponentFromEL(facesContext);
+                        }
+                    }
                 }
             }
             finally