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.
| Online: | 16 Members of 4546 |
| Forum: Seam Users |
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.
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}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 Literalany way to get around?
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.
Try using the richfaces include:
<a4j:include viewId="#{element.attributes.name}"/>Cheers,
Damian.