Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-1412

<s:decorate /> with template property

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.2.1.GA
    • Fix Version/s: 1.3.0.ALPHA
    • Component/s: None
    • Labels:
      None
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Wrap the input in <ui:define />
      <ui:define name="input"><h:inputText value="#

      {mitgliedHome.instance.name}

      " required="true"/></ui:define>

      and then use

      <ui:insert name="input"/> instead of <ui:insert />

      Show
      Wrap the input in <ui:define /> <ui:define name="input"><h:inputText value="# {mitgliedHome.instance.name} " required="true"/></ui:define> and then use <ui:insert name="input"/> instead of <ui:insert />

      Description

      I am trying to use the template property of <s:decorate /> in Seam 1.2.1 .GA but it doesn't work for me. The <ui:insert /> in the decorateField.xhtml does not only insert the input child of <s:decorate /> but the whole page (which is in a <ui:define /> because it uses a page template).

      If I explicilty define

      <ui:define name="input"><h:inputText value="#

      {mitgliedHome.instance.name}

      " required="true"/></ui:define>

      and adjust the decorateField.xhtml file accordingly it works. I am not sure whether this is a bug, a documentation issue or if I made a silly mistake but I thought I report it before it gets lost.

      Main page:

      <!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>

      decorateField:

      <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>

      </ui:composition>

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                gavin.king Gavin King
                Reporter:
                fhh fhh (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: