[jboss-cvs] jboss-seam/examples/blog/view ...

Gavin King gavin.king at jboss.com
Fri Nov 9 14:39:56 EST 2007


  User: gavin   
  Date: 07/11/09 14:39:56

  Modified:    examples/blog/view   post.xhtml
  Added:       examples/blog/view   edit.xhtml
  Log:
  use s:decorate properly
  
  Revision  Changes    Path
  1.12      +25 -50    jboss-seam/examples/blog/view/post.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: post.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/blog/view/post.xhtml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- post.xhtml	27 Sep 2007 12:01:19 -0000	1.11
  +++ post.xhtml	9 Nov 2007 19:39:56 -0000	1.12
  @@ -9,61 +9,36 @@
   
   <ui:define name="content">
      <div class="blogEntry">
  -      <h:form>
  +      <h:form id="newBlogEntry">
         
            <h:messages globalOnly="true" styleClass="errors"/>
            
  -         <f:facet name="afterInvalidField">
  -            <s:span>
  -               &#160;Error:&#160;
  -               <s:message/>
  -            </s:span>
  -         </f:facet>
  -         <f:facet name="aroundInvalidField">
  -            <s:span styleClass="errors"/>
  -         </f:facet>
  -         
  -         <s:validateAll>
  -            <div>
  -               <h:outputLabel for="id">Id: </h:outputLabel>
  -            </div>
  -            <div class="hilite">
  -               <s:decorate>
  -                  <h:inputText value="#{blogEntry.id}" size="20" maxlength="20" required="true" id="id"/>
  +         <s:decorate template="edit.xhtml" id="id">
  +            <ui:define name="label">Id</ui:define>
  +            <h:inputText value="#{blogEntry.id}" size="20" maxlength="20" required="true" id="idInput"/>
                  </s:decorate>
  -            </div>
  -            <div>
  -               <h:outputLabel for="title">Title: </h:outputLabel>
  -            </div>
  -            <div class="hilite">
  -               <s:decorate>
  -                  <h:inputText value="#{blogEntry.title}" size="70" maxlength="70" required="true" id="title">
  +      
  +         <s:decorate template="edit.xhtml" id="title">
  +            <ui:define name="label">Title</ui:define>
  +            <h:inputText value="#{blogEntry.title}" size="70" maxlength="70" required="true" id="titleInput">
                     	 <s:validateFormattedText />
                     </h:inputText>
                  </s:decorate>
  -            </div>
  -            <div>
  -               <h:outputLabel for="excerpt">Excerpt (optional): </h:outputLabel>
  -            </div>
  -            <div class="hilite">
  -               <s:decorate>
  -                  <h:inputTextarea value="#{blogEntry.excerpt}" cols="68" rows="3" id="excerpt">
  +      
  +         <s:decorate template="edit.xhtml" id="excerpt">
  +            <ui:define name="label">Excerpt (optional)</ui:define>
  +            <h:inputTextarea value="#{blogEntry.excerpt}" cols="68" rows="3" id="excerptInput">
                  	     <s:validateFormattedText />
                     </h:inputTextarea>
                  </s:decorate>
  -            </div>
  -            <div>
  -               <h:outputLabel for="body">Body text: </h:outputLabel>
  -            </div>
  -            <div class="hilite">
  -               <s:decorate>
  -                  <h:inputTextarea value="#{blogEntry.body}" cols="68" rows="20" required="true" id="body"/>
  +      
  +         <s:decorate template="edit.xhtml" id="body">
  +            <ui:define name="label">Body text</ui:define>
  +            <h:inputTextarea value="#{blogEntry.body}" cols="68" rows="20" required="true" id="bodyInput"/>
                  </s:decorate>
  -            </div>
  -         </s:validateAll>
            
            <div>
  -            <h:commandButton value="Post"/>
  +            <h:commandButton value="Post" id="post"/>
            </div>
   
         </h:form>
  
  
  
  1.1      date: 2007/11/09 19:39:56;  author: gavin;  state: Exp;jboss-seam/examples/blog/view/edit.xhtml
  
  Index: edit.xhtml
  ===================================================================
  <!DOCTYPE composition 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: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 id="inputLabel">
              <ui:insert name="label"/>:
          </s:label>
      </div>
      
      <div class="hilite">
          <s:span styleClass="#{invalid ? 'errors' : ''}" id="input">
              <s:validateAll>
                  <ui:insert/>
              </s:validateAll>
          </s:span>
          <s:span rendered="#{invalid}" styleClass="errors" id="inputError">
              &#160;Error:&#160;
              <s:message/>
          </s:span>
      </div>
      
  </ui:composition>
  
  



More information about the jboss-cvs-commits mailing list