Volodymyr Siedlecki created MYFACES-4505:
--------------------------------------------
Summary: 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
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="hour minute"
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}
>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)