jakartaee / faces

Jakarta Faces
Other
109 stars 55 forks source link

TCK Challenge: faces22/ajax test does not need to look at the id from the root #1854

Closed volosied closed 1 year ago

volosied commented 1 year ago

Challenged Test: ee.jakarta.tck.faces.test.servlet30.ajax.Issue3171IT#testExceptionDuringRenderOk

TCK Version: Jakarta Faces 4.0.x

Tested Implementation: MyFaces 4.0.2-SNAPSHOT

The problem is with render=“:willThrowException” portion of the facelet. The separator character (the colon in our case) tells Faces to use the root UIComponent as the base to begin it’s search. A recent change in MyFaces now throws a ComponentNotFoundException if the element is not found. This exception was added via MYFACES-4624.

The UIComponent#findComponent API documentation states the steps for the search. Specifically, the form is not searched further because the doc states ” that if a descendant NamingContainer is found, its own facets and children are not searched.” The UIForm is a NamingContainer, so no search is performed for the form and its children in MyFaces. (However, one thing that may need clarification is how prependId=false should affect the search, perhaps?)

Additionally, the test was added for Issue 3175 to verify whether the javascript error handler is invoked if an error occurs during an Ajax response. MyFaces conforms to this behavior (if the naming separator is removed from the render string.)

A pull request will be provided to update this test to pass on Mojarra and MyFaces.