users@javaserverfaces.java.net

JSF is missing a robust pattern to render a dynamic list of templates

From: Nicolas Labrot <nithril_at_gmail.com>
Date: Mon, 18 Feb 2013 23:26:13 +0100

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