[ 
https://issues.apache.org/jira/browse/MYFACES-4505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17636735#comment-17636735
 ] 

Volodymyr Siedlecki commented on MYFACES-4505:
----------------------------------------------

[~tandraschko] Any chance you could look at this one? If not, I can try to 
create a fix.

> TCK: Spec1567IT: Ajax does not execute specified targets in composite 
> component
> -------------------------------------------------------------------------------
>
>                 Key: MYFACES-4505
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4505
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 4.0.0-RC2
>            Reporter: Volodymyr Siedlecki
>            Priority: Major
>         Attachments: test-faces40-ajax.war
>
>
> The [Spec1567IT|https://github.com/jakartaee/faces/issues/1567] test in the 
> TCK is failing due. MyFaces is still executing only individual components 
> within the composite component.
> Using the example in the spec issue, MyFaces should execute the component as 
> a whole (or at least the targets), not it's parts.  I've attached the TCK app 
> (contains Mojarra Jars) and the source for reference.
> Looking at the generated HTML, we can see the obvious difference in the third 
> argument where MyFaces is missing the IDs (which are from the targets 
> attribute).
> Source Code ([Full App 
> Here|https://github.com/jakartaee/faces/tree/master/tck/faces40/ajax/src/main]):
> {code:java}
> <cc:clientBehavior name="change" default="true" targets="input1 input2" 
> event="change" />{code}
> Mojarra:
>  
> {code:java}
> <input id="form1:inputs:input1" type="text" name="form1:inputs:input1" 
> onchange="mojarra.ab(this,event,'change','form1:inputs:input1 
> form1:inputs:input2','form1:messages')"> {code}
> MyFaces:
> {code:java}
> <input id="form1:inputs:input1" name="form1:inputs:input1" type="text" 
> value="" onchange="myfaces.ab(this,event,'change','','form1:messages')"> 
> {code}
> When a change does occur to the inputs, only the changed input is updated, 
> not the other targets (i.e setForm1input1 and setForm1input2 for the first 
> form)
> From looking at the code, MyFaces gets the targets and then find the 
> components (for each target) to attach the ajax behavior to.  As stated in 
> the spec issue. this is the incorrect procedure.
> [https://github.com/apache/myfaces/blob/d83e3c7c498d588de3b7a65da40c2152b1076829/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorAttachedObjectTargetImpl.java#L67-L84]
> To be spec compliant, we should skip this section, and grab the targets and 
> set to the execute property of the Ajax Behavior.  This set would occur with 
> the AjaxHandler#applyAttachedObject method.  Targets would need to be either 
> passed in or taken from the parent component argument. 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to