1 Reply Latest reply on Jul 15, 2011 6:50 PM by Shawn Zimmerman

    s:decorate and h:panelGrid

    Thorsten Hake Newbie


      I'm fairly new to seam and tried to create a nice looking form using s:decorate in combination with h:panelGrid.

      My problem is that it seems to me that h:panelGrid and s:decorate are incompatible. s:decorate expands after h:panelGrid has already drawn the table around it. I even debugged the renderer of h:panelGrid to see that the s:decorate tag has not been rendered , when the renderer calculates which tag to place in which cell. So as a result each input field with its label and error message is placed within one cell of the table rendered by panelGrid. I would expect that s:decorate is expanded before panelGrid is rendered.

      Has anybody tried this before? Is there a simple way to solve this problem?

      I'm using Seam 2.2.0 GA + RichFaces 3.3.3 + jsf-facelets 1.1.14 + Sun JSF Implementation 1.2.12

      Here is my page:

      <ui:composition template="/WEB-INF/layout/template.xhtml">
                <ui:define name="body">
                     <h:form id="createUser">
                          <f:facet name="header">
                          <h:panelGrid columns="3">
                               <s:decorate enclose="false" template="/WEB-INF/components/inputField.xhtml">
                                    <ui:define name="label">#{messages['user.userAliasLabel']}</ui:define>
                                    <h:inputText id="userAlias" label="#{messages['user.userAliasLabel']}" value="#{newUser.userAlias}" required="true" />
                               <s:decorate enclose="false" template="/WEB-INF/components/inputField.xhtml">
                                    <ui:define name="label">#{messages['user.userPasswordLabel']}</ui:define>
                                    <h:inputText label="#{messages['user.userPasswordLabel']}" id="password" value="#{newUser.password}" required="true" />
                               <s:decorate enclose="false" template="/WEB-INF/components/inputField.xhtml">
                                    <ui:define name="label">#{messages['user.userPasswordConfirm']}</ui:define>
                                    <h:inputText id="passwordConfirm" label="#{messages['user.userPasswordConfirm']}" required="true" >
                                                <s:validateEquality for="password" />
                               <h:commandButton action="#{userAdministration.add(newUser)}" value="#{messages['userAdministration.createUser']}"/>

      The following is the simple template for the inputFields:

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                <s:label styleClass="#{invalid?'error':''}">
                     <ui:insert name="label"/>
                <s:message styleClass="error" for="#{field}"/>