-
1. Re: <s:decorate /> with template property?
gavin.king Jun 4, 2007 1:11 PM (in response to fhh)You should not need to do that. Look at the examples.
-
2. Re: <s:decorate /> with template property?
fhh Jun 4, 2007 1:30 PM (in response to fhh)Otherwise it doesn't work. It will insert the body of the page I defined and not just the input.
It seems like a bug to me. I will post the code once I am at home.
Regards
Felix -
3. Re: <s:decorate /> with template property?
fhh Jun 4, 2007 3:46 PM (in response to fhh)Here's the code of the form:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:c="http://java.sun.com/jstl/core" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:rich="http://richfaces.ajax4jsf.org/rich" template="/WEB-INF/templates/standard.xhtml"> <ui:define name="title">Title</ui:define> <ui:define name="body"> <h:form> <rich:toolBar height="26" itemSeparator="line"> <rich:toolBarGroup rendered="#{not mitgliedHome.managed}"> <h:commandLink action="#{mitgliedHome.persist}"><h:graphicImage value="/images/button_ok.png" /><h:outputText value="Save" /></h:commandLink> </rich:toolBarGroup> </rich:toolBar> <h:messages globalOnly="true"/> <s:decorate template="decorateField.xhtml"> <ui:define name="label">Username:</ui:define> <h:inputText value="#{userHome.instance.name}" required="true"/> </s:decorate> </h:form> </ui:define> </ui:composition>
And the decorateField.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:s="http://jboss.com/products/seam/taglib"> <div> <s:label styleClass="#{invalid?'error':''}"> <ui:insert name="label"/> <s:span styleClass="required" rendered="#{required}">*</s:span> </s:label> <span class="#{invalid?'error':''}"> <!-- <h:graphicImage src="img/error.gif" rendered="#{invalid}"/> --> <s:validateAll> <ui:insert /> </s:validateAll> </span> <s:message styleClass="error"/> </div> </ui:composition>
The result looks like this:
http://felix.dyndns.tv/static/s-decorate-error.png
Regards
Felix -
4. Re: <s:decorate /> with template property?
dan.j.allen Jun 10, 2007 12:26 AM (in response to fhh)Actually, this concern is legitimate. I can confirm that both of you are correct. If you run the seam examples, they work perfectly. If you use your own setup with jsf-facelets-1.1.11.jar, then you get an error when trying to use the bare <ui:insert />. Apparently, seam has a modified (or just alternate) version of Facelets other than the latest stable 1.1.11 version.
Does anyone know which version of facelets is bundled with Seam? I can assure you that if you take the jsf-facelets-1.1.11.jar file and put it into the seam distribution, the examples using s:decorate with templates will not work. -
5. Re: <s:decorate /> with template property?
gavin.king Jun 10, 2007 12:06 PM (in response to fhh)It's easy to see which version we have using fisheye:
http://fisheye.jboss.com/browse/JBoss/jboss-seam/lib/jsf-facelets.jar
ie. it is a version of 1.1.12 with a special bug fix for ui:decorate.
So if you're using some other version of facelets other than the one we recommend, its hardly surprising that you run into problems... -
6. Re: <s:decorate /> with template property?
fhh Jun 10, 2007 3:54 PM (in response to fhh)Okay, thanks for the information. I use maven and used simply the latest available version.
Could you add a hint to the documentation? I think quite a lot of people might bump into this.
Regards
Felix