Permalink
Browse files

MYFACES-4068 Ajax-Listener (PrimeFaces) is not called for some select…

…ion-components

git-svn-id: https://svn.apache.org/repos/asf/myfaces/core/trunk@1766756 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 5d9528a commit baa383cc00e6a3bb97c4ff15520aaa367b48a833 lu4242 committed Oct 27, 2016
@@ -66,6 +66,7 @@
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 static void decodeClientBehaviors(FacesContext facesContext, UIComponent
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)

0 comments on commit baa383c

Please sign in to comment.