3 Replies Latest reply on Feb 22, 2012 11:12 AM by Lin Claire

    s:decorate to ui:decorate migration

    Alex B Newbie

      I am trying to migrate from  Seam2 to Seam 3,one of issues is I have alot of forums which use s:decorate template like so:

      <ui:composition  xmlns="http://www.w3.org/1999/xhtml"
          <div class="prop">
              <s:label id="editLabel" styleClass="name #{invalid?'errors':''}">
                  <ui:insert name="label"/>
                  <s:span styleClass="required" rendered="#{required}">*</s:span>
              <span id="editSpan" class="value #{invalid?'errors':''}">
              <s:message styleClass="error errors"/>        

      i have replaced s:decorate with ui:decorate, however how to replace s:message and required asterisk? Replacing with h:message doesn't work normally since it needs a 'for' field which is not being passed to the tablate,it seems. neither is


      being passed for the field.

      Thank you for your help, Alex

        • 1. Re: s:decorate to ui:decorate migration
          Lin Claire Newbie

          Hi Alex,


          I have the same problem now. May I know if you find the solution?

          • 2. Re: s:decorate to ui:decorate migration
            Bernard Labno Master

            IUse this:

            {code:xml}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


            <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"

                  xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:cc="http://java.sun.com/jsf/composite" xmlns:c="http://java.sun.com/jsp/jstl/core">


                <title>This will not be present in rendered output</title>





            <cc:interface componentType="org.jboss.seam.faces.component.UIInputContainer">

                <cc:attribute name="label" required="true"/>

                <cc:attribute name="ajax" required="false" default="false"/>

                <cc:attribute name="inputs" required="false" default="1"/>

                <cc:attribute name="rendered" required="false" type="java.lang.Boolean"/>

                <cc:attribute name="styleClass" required="false" type="java.lang.String"/>




                <div class="prop#{empty cc.attrs.styleClass ? '' : ' '.concat(cc.attrs.styleClass)}#{cc.attrs.invalid ? ' errors' : ''}" id="#{cc.clientId}">

                    <h:outputLabel id="label" for="" value="#{cc.attrs.label}:" styleClass="label">

                        <h:panelGroup styleClass="required" rendered="#{cc.attrs.required}">*</h:panelGroup>


                     <span class="input">







                    <h:panelGroup rendered="#{cc.attrs.invalid}" styleClass="messages">

                        <c:forEach var="i" begin="1" end="#{cc.attrs.inputs}">

                            <h:message id="message#{i}" for=""/>











            • 3. Re: s:decorate to ui:decorate migration
              Lin Claire Newbie



              Thanks for your help.