Closed Hurz closed 3 months ago
OK, this is regression of https://github.com/jakartaee/faces/issues/1567
Work around for now, use execute="@this"
instead of execute="#{cc.clientId}"
. Removing execute
attribute should also work as that should default to @this
nonetheless.
Accessing the clientId of a composite component can be initialized early in its lifecycle when referencing it in a f:ajax execute. This early initialization will prevent the component to being aware of its parents and can therefore cause duplicate ID errors.
To Reproduce
I've attached a sample application DemoDuplicateComponentBug.zip. Here is the code of the involved components of the sample application:
index.xhtml
outerComponent.xhtml
middleComponent.xhtml
innerComponent.xhtml
Running this on the newest Wildfly 31.0.1.Final and opening http://localhost:8080/web-application/ will result in a duplicate component ID error of "middleComponentInOuterComponent". Referencing the
cc.clientId
in any other way will not cause this error. Here is the Stacktrace (sorry for the german error output):Expected behavior
Expected behavior is the rendering of two components with the IDs
contentForm:firstInstanceOfOuterComponent:middleComponentInOuterComponent:j_idt2:input
andcontentForm:firstInstanceOfOuterComponent:middleComponentInOuterComponent:j_idt5:input
or similar chained IDs.Environment:
To modify the attached reproducer for Wildfly versions before 27 simply replace the jakarta with javax of the Faces Servlet in the web.xml.