You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2016/10/27 03:07:52 UTC

svn commit: r1766758 - /myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java

Author: lu4242
Date: Thu Oct 27 03:07:52 2016
New Revision: 1766758

URL: http://svn.apache.org/viewvc?rev=1766758&view=rev
Log:
MYFACES-4068 Ajax-Listener (PrimeFaces) is not called for some selection-components

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

Modified: myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java?rev=1766758&r1=1766757&r2=1766758&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java (original)
+++ myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java Thu Oct 27 03:07:52 2016
@@ -66,6 +66,7 @@ import org.apache.myfaces.shared.renderk
 import org.apache.myfaces.shared.renderkit.html.util.FormInfo;
 import org.apache.myfaces.shared.renderkit.html.util.HTMLEncoder;
 import org.apache.myfaces.shared.renderkit.html.util.OutcomeTargetUtils;
+import org.apache.myfaces.shared.util.StringUtils;
 
 public final class HtmlRendererUtils
 {
@@ -291,7 +292,20 @@ public final class HtmlRendererUtils
                     if (clientBehaviorList != null
                             && !clientBehaviorList.isEmpty())
                     {
-                        String clientId = paramMap.get("javax.faces.source");
+                        String sourceId = paramMap.get("javax.faces.source");
+                        String componentClientId = component.getClientId(facesContext);
+                        String clientId = sourceId;
+                        if (sourceId.startsWith(componentClientId) &&
+                            sourceId.length() > componentClientId.length())
+                        {
+                            String item = sourceId.substring(componentClientId.length()+1);
+                            // If is item it should be an integer number, otherwise it can be related to a child 
+                            // component, because that could conflict with the clientId naming convention.
+                            if (StringUtils.isInteger(item))
+                            {
+                                clientId = componentClientId;
+                            }
+                        }
                         if (component.getClientId(facesContext).equals(clientId))
                         {
                             if (clientBehaviorList instanceof RandomAccess)