4 Replies Latest reply on Jan 17, 2008 9:13 AM by Valtoni Boaventura

    Facelets 1.1.11 and <s:decorate> problem

    Bieth Bruno Newbie

      I just had a problem with facelets version 1.1.11 when using seam's decorate tag. The <ui:insert/> doesn't insert the content of the decorate childs but the content of the last (?) <ui:define>. In my case the body definition. In result I have duplicate tags (and duplicate id errors).
      I switched back to the seam's facelets version and everything work fine.

        • 1. Re: Facelets 1.1.11 and <s:decorate> problem
          Pete Muir Master

          Yes, we recommend you use the versions of libraries we distribute with Seam, not random versions ;)

          • 2. Re: Facelets 1.1.11 and <s:decorate> problem
            Anthony Whitford Newbie

            Out of curiousity, what is special with the facelets library that comes with Seam? (I can see that it doesn't match 1.1.11 or 1.1.12 -- both of which are several months old already...)

            As a Maven user, I typically just enter a dependency that is available from Ibiblio or somewhere... In this case, I had to override the jar as you suggest, but I'm just curious as to the background.

            • 3. Re: Facelets 1.1.11 and <s:decorate> problem
              Pete Muir Master

              We danced around a smoking cauldron at full moon and...

              Actually, IIRC, its 1.1.12, but not the latest version I suspect. Once Jacob marks 1.1.12 stable we will update to that. We extends classes in facelets to get s:decorate to work so if the facelets api changes...

              • 4. <s:decorate> problem
                Valtoni Boaventura Newbie

                I have one postback to this issue. I have exactly what founded in edit.xhtml in seam example booking:

                <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 class="entry">
                 <span class="label">
                 <ui:insert name="label"/>
                 </span>
                 <span class="input">
                 <ui:insert/>
                 </span>
                 </div>
                
                </ui:composition>


                And this cause the problem java.lang.IllegalStateException: duplicate Id for a component. You have to put name in 'span class="input"' and define it in your xhtml source, wich solves the problem. Here the piece of my code:

                <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 id="entradaDeErro" class="entry">
                 <s:label id="labelDeErro" styleClass="label #{invalid?'errors':''}">
                 <ui:insert id="labelDeErro" name="label"/>
                 <s:span id="requeridoErro" styleClass="required" rendered="#{required}"> *</s:span>
                 </s:label>
                 <span id="spanDeErro" class="input #{invalid?'errors':''}">
                 <s:validateAll>
                 <ui:insert id="componente" name="conteudo"/>
                 </s:validateAll>
                 </span>
                 <s:message id="mensagensErro" styleClass="error errors"/>
                 </div>
                
                </ui:composition>
                


                I hope this help you.

                Regards,
                Valtoni