myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1153265 - in /myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html: HtmlButtonRendererBase.java HtmlRendererUtils.java
Date Tue, 02 Aug 2011 20:32:24 GMT
Author: lu4242
Date: Tue Aug  2 20:32:23 2011
New Revision: 1153265

URL: http://svn.apache.org/viewvc?rev=1153265&view=rev
Log:
MYFACES-3180 h:commandButton with image breaks ajax

Modified:
    myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
    myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java

Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java?rev=1153265&r1=1153264&r2=1153265&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
(original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
Tue Aug  2 20:32:23 2011
@@ -72,12 +72,12 @@ public class HtmlButtonRendererBase
             uiComponent.queueEvent(new ActionEvent(uiComponent));
 
             org.apache.myfaces.shared.renderkit.RendererUtils.initPartialValidationAndModelUpdate(uiComponent,
facesContext);
-            
-            if (uiComponent instanceof ClientBehaviorHolder &&
-                    !HtmlRendererUtils.isDisabled(uiComponent))
-            {
-                HtmlRendererUtils.decodeClientBehaviors(facesContext, uiComponent);
-            }
+        }
+        
+        if (uiComponent instanceof ClientBehaviorHolder &&
+                !HtmlRendererUtils.isDisabled(uiComponent))
+        {
+            HtmlRendererUtils.decodeClientBehaviors(facesContext, uiComponent);
         }
     }
 

Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java?rev=1153265&r1=1153264&r2=1153265&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
(original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
Tue Aug  2 20:32:23 2011
@@ -1751,15 +1751,20 @@ public final class HtmlRendererUtils {
         if (sourceId == null || !sourceId.equals(clientId)) {
             return false;
         }
+        boolean partialOrBehaviorSubmit = false;
         String behaviorEvent = params.get("javax.faces.behavior.event");
         if (behaviorEvent != null) {
-            return ClientBehaviorEvents.ACTION.equals(behaviorEvent);
+            partialOrBehaviorSubmit = ClientBehaviorEvents.ACTION.equals(behaviorEvent);
+            if (partialOrBehaviorSubmit)
+            {
+                return partialOrBehaviorSubmit;
+            }
         }
         String partialEvent = params.get("javax.faces.partial.event");
         if (partialEvent != null) {
-            return ClientBehaviorEvents.CLICK.equals(partialEvent);
+            partialOrBehaviorSubmit = ClientBehaviorEvents.CLICK.equals(partialEvent);
         }
-        return false;
+        return partialOrBehaviorSubmit;
     }
 
     /**
@@ -2406,7 +2411,8 @@ public final class HtmlRendererUtils {
                                                                 List<UIComponent> children,
boolean skipNullValue, boolean skipUnrendered, boolean skipNullName) {
         List<UIParameter> params = null;
 
-        for (UIComponent child : children) {
+        for (int i = 0, size = children.size(); i < size; i++) {
+            UIComponent child = children.get(i);
             if (child instanceof UIParameter) {
                 UIParameter param = (UIParameter) child;
 



Mime
View raw message