Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
26. Jun 2008, 15:53 CET | Link

facelets' ui:composition tag doesen't allow an EL expression on the template attribute, preventing the creation of a dynamic templating mechanism. Is there a way to get around that? Does anybody know if is there any plan to add such a functionality? Thanks.

4 Replies:
26. Jun 2008, 16:28 CET | Link

ui:composition with EL works for me.

Just tested the following simple test:

with a req param called page with the value /WEB-INF/layout/template.xhtml


<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
          xmlns:rich="http://richfaces.ajax4jsf.org/rich"
          xmlns:s="http://jboss.com/products/seam/taglib"
          template="#{param.page}">
                

        <ui:define name="body">
                #{param.page}
26. Jun 2008, 17:49 CET | Link

I'm sorry. The ui:insert only supports literals :

17:45:54,531 ERROR [STDERR] com.sun.facelets.tag.TagAttributeException: /components/insert.xhtml @9,51 <ui:ins
ert name="#{element.attributes.name}"> Must be Literal

any way to get around?

26. Jun 2008, 18:20 CET | Link

I've got nothing, sorry.

To me it feels a bit strange to use a dynamic name for the ui:insert, curious about your usecase.

26. Jun 2008, 18:20 CET | Link

Try using the richfaces include:

<a4j:include viewId="#{element.attributes.name}"/>

Cheers,

Damian.