Hi Nicolas,
If you are using ui:include you need to make sure the included content does
not re-use ids. This is because c:forEach is NOT a NamingContainer.
Your snippet would works fine if the content referred to by the
#{component.uri}
value expression has unique ids. One way to accomplish that is to not
use fixed
ids in the included content.
Regards,
Manfred
On 2/18/2013 4:26 PM, Nicolas Labrot wrote:
> Hello,
>
> I want to be able to render a collection of unpredictive xhtml
> templates inside a page
>
> Actually, the only pattern to implement this purpose is the c:forEach
> / ui:include one:
> <c:forEach items="#{components}" var="component">
> <ui:include src="#{component.uri}"/>
> </c:forEach>
> This pattern has flaws :
> http://java.net/jira/browse/JAVASERVERFACES-2548
> http://java.net/jira/browse/JAVASERVERFACES-2514
>
> These issues (and associated) were closed as "Works as designed"
>
> If c:forEach / ui:include work as designed, the obvious conclusion is
> that JSF is missing a robust pattern to render a dynamic list of
> templates which do not have flaws.
>
> In my opinion this pattern can be implemented with :
> - a new tag that iterates over a collection and is compatible with
> ui:include
> - a new tag that includes a template and is compatible with ui:repeat
>
> What is your opinion?
>
> Nicolas