Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.0-RC2
-
None
-
None
Description
The Spec1567IT 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):
<cc:clientBehavior name="change" default="true" targets="input1 input2" event="change" />
Mojarra:
<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')">
MyFaces:
<input id="form1:inputs:input1" name="form1:inputs:input1" type="text" value="" onchange="myfaces.ab(this,event,'change','','form1:messages')">
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.
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.