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

Gavin King gavin.king at jboss.com
Tue Mar 20 17:34:25 EDT 2007


  User: gavin   
  Date: 07/03/20 17:34:25

  Modified:    examples/booking/view        book.xhtml confirm.xhtml
                        hotel.xhtml register.xhtml
  Added:       examples/booking/view        display.xhtml edit.xhtml
                        hotelview.xhtml
  Log:
  get rid of s:decorateall
  
  Revision  Changes    Path
  1.35      +93 -89    jboss-seam/examples/booking/view/book.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: book.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/booking/view/book.xhtml,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -b -r1.34 -r1.35
  --- book.xhtml	18 Mar 2007 20:18:41 -0000	1.34
  +++ book.xhtml	20 Mar 2007 21:34:25 -0000	1.35
  @@ -13,30 +13,20 @@
   	<h1>Book Hotel</h1>
   </div>
   <div class="section">
  -    <ui:include src="hotelview.xhtml"/>
  -
   	<div class="entry errors">
   		<h:messages globalOnly="true"/>
   	</div>
   
  +	<ui:include src="hotelview.xhtml"/>
  +	
  +	<div style="clear:both"/>
  +
   	<h:form id="booking">
   	<fieldset>
  -		<s:validateAll>
  -          <s:decorateAll rowClass="entry" 
  -                         labelColumnClass="label" 
  -                         fieldColumnClass="input"
  -                         messageColumnClass="errors"
  -                         id="bookingFields">
  -          
  -            <f:facet name="aroundInvalidField">
  -                <s:span styleClass="errors"/>
  -            </f:facet>
  -            <f:facet name="message">
  -                <s:message/>
  -            </f:facet>
   		    
  -			<s:decorate id="checkinDateDecorate">
  -                <f:facet name="label">Check In Date:</f:facet>
  +		<s:decorate id="checkinDateDecorate" template="edit.xhtml">
  +			<ui:define name="label">Check In Date:</ui:define>
  +			<ui:define name="input">
                   <h:inputText id="checkinDate" value="#{booking.checkinDate}" required="true">
                       <s:convertDateTime pattern="MM/dd/yyyy"/>
                       <a:support event="onblur" reRender="checkinDateDecorate"/>
  @@ -44,10 +34,12 @@
                   <s:selectDate for="checkinDate">
                       <h:graphicImage url="img/dtpick.gif" style="margin-left:5px;cursor:pointer"/>
                   </s:selectDate>
  +			</ui:define>
               </s:decorate>
   			
  -            <s:decorate id="checkoutDateDecorate">
  -                <f:facet name="label">Check Out Date:</f:facet>
  +		<s:decorate id="checkoutDateDecorate" template="edit.xhtml">
  +			<ui:define name="label">Check Out Date:</ui:define>
  +			<ui:define name="input">
                   <h:inputText id="checkoutDate" value="#{booking.checkoutDate}" required="true">
                       <s:convertDateTime pattern="MM/dd/yyyy"/>
                       <a:support event="onblur" reRender="checkoutDateDecorate"/>
  @@ -55,37 +47,51 @@
                   <s:selectDate for="checkoutDate">
                       <h:graphicImage url="img/dtpick.gif" style="margin-left:5px;cursor:pointer"/>
                   </s:selectDate>
  +			</ui:define>
               </s:decorate>
   
  +		<s:decorate id="bedsDecorate" template="edit.xhtml">
  +			<ui:define name="label">Room Preference:</ui:define>
  +			<ui:define name="input">
   			<h:selectOneMenu id="beds" value="#{booking.beds}">
  -				<f:facet name="label">Room Preference:</f:facet>
   				<f:selectItem itemLabel="One king-size bed" itemValue="1"/>
   				<f:selectItem itemLabel="Two double beds" itemValue="2"/>
   				<f:selectItem itemLabel="Three beds" itemValue="3"/>
   			</h:selectOneMenu>
  +			</ui:define>
  +		</s:decorate>
   			
  +		<s:decorate id="smokingDecorate" template="edit.xhtml">
  +			<ui:define name="label">Smoking Preference:</ui:define>
  +			<ui:define name="input">
   			<h:selectOneRadio id="smoking" value="#{booking.smoking}" layout="pageDirection" styleClass="radio">
  -		    	<f:facet name="label">Smoking Preference:</f:facet>
   				<f:selectItem itemLabel="Smoking" itemValue="true"/>
   				<f:selectItem itemLabel="Non Smoking" itemValue="false"/>
   			</h:selectOneRadio>
  +			</ui:define>
  +		</s:decorate>
   	
  -			<s:decorate id="creditCardDecorate">
  -			    <f:facet name="label">Credit Card #:</f:facet>
  +		<s:decorate id="creditCardDecorate" template="edit.xhtml">
  +			<ui:define name="label">Credit Card #:</ui:define>
  +			<ui:define name="input">
   				<h:inputText id="creditCard" value="#{booking.creditCard}" required="true">
                       <a:support event="onblur" reRender="creditCardDecorate"/>
                   </h:inputText>
  +			</ui:define>
   			</s:decorate>
   	
  -			<s:decorate id="creditCardNameDecorate">
  -				<f:facet name="label">Credit Card Name:</f:facet>
  +		<s:decorate id="creditCardNameDecorate" template="edit.xhtml">
  +			<ui:define name="label">Credit Card Name:</ui:define>
  +			<ui:define name="input">
   				<h:inputText id="creditCardName" value="#{booking.creditCardName}" required="true">
                       <a:support event="onblur" reRender="creditCardNameDecorate"/>
                   </h:inputText>
  +			</ui:define>
   			</s:decorate>
   	
  -			<s:decorate id="creditCardExpiryDecorate">
  -				<f:facet name="label">Credit Card Expiry:</f:facet>
  +		<s:decorate id="creditCardExpiryDecorate" template="edit.xhtml">
  +			<ui:define name="label">Credit Card Expiry:</ui:define>
  +			<ui:define name="input">
   				<h:selectOneMenu id="creditCardExpiryMonth" value="#{booking.creditCardExpiryMonth}">
   					<f:selectItem itemLabel="Jan" itemValue="1"/>
   					<f:selectItem itemLabel="Feb" itemValue="2"/>
  @@ -107,16 +113,14 @@
   					<f:selectItem itemLabel="2008" itemValue="2008"/>
   					<f:selectItem itemLabel="2009" itemValue="2009"/>
   				</h:selectOneMenu>
  +			</ui:define>
   			</s:decorate>
   			
  -			<s:fragment>
  +		<div class="buttonBox">
   				<h:commandButton id="proceed" value="Proceed" action="#{hotelBooking.setBookingDetails}"/>
   				&#160;
   				<s:button id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
  -			</s:fragment>
  -				
  -		  </s:decorateAll>
  -		</s:validateAll>
  +		</div>
   		
   	</fieldset>
   	</h:form>
  
  
  
  1.20      +30 -24    jboss-seam/examples/booking/view/confirm.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: confirm.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/booking/view/confirm.xhtml,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -b -r1.19 -r1.20
  --- confirm.xhtml	18 Mar 2007 20:18:41 -0000	1.19
  +++ confirm.xhtml	20 Mar 2007 21:34:25 -0000	1.20
  @@ -17,28 +17,35 @@
   
   	<ui:include src="hotelview.xhtml"/>
   		
  -	<s:decorateAll rowClass="entry" 
  -				   labelColumnClass="label" 
  -				   fieldColumnClass="output"
  -				   id="booking">
  -		
  +	<s:decorate template="display.xhtml">
  +		<ui:define name="label">Total Payment:</ui:define>
  +		<ui:define name="value">
   		<h:outputText value="#{booking.total}">
  -			<f:facet name="label">Total Payment:</f:facet>
   			<f:convertNumber type="currency" currencySymbol="$"/>
   		</h:outputText>
  +		</ui:define>
  +	</s:decorate>
   
  -		<h:outputText value="#{booking.checkinDate}">
  -			<f:facet name="label">Check In Date:</f:facet>
  -		</h:outputText>
  -
  -		<h:outputText value="#{booking.checkoutDate}">
  -			<f:facet name="label">Check Out Date:</f:facet>
  -		</h:outputText>
  -
  -		<h:outputText value="#{booking.creditCard}">
  -			<f:facet name="label">Credit Card #:</f:facet>
  -		</h:outputText>
  +	<s:decorate template="display.xhtml">
  +		<ui:define name="label">Check In Date:</ui:define>
  +		<ui:define name="value">
  +			<h:outputText value="#{booking.checkinDate}"/>
  +		</ui:define>
  +	</s:decorate>
  +
  +	<s:decorate template="display.xhtml">
  +		<ui:define name="label">Check Out Date:</ui:define>
  +		<ui:define name="value">
  +			<h:outputText value="#{booking.checkoutDate}"/>
  +		</ui:define>
  +	</s:decorate>
  +
  +	<s:decorate template="display.xhtml">
  +		<ui:define name="label">Credit Card #:</ui:define>
  +		<ui:define name="value">#{booking.creditCard}</ui:define>
  +	</s:decorate>
   		
  +	<div class="buttonBox">
   		<h:form id="confirm">
   			<h:commandButton id="confirm" value="Confirm" action="#{hotelBooking.confirm}"/>
   			&#160;
  @@ -46,8 +53,7 @@
       		&#160;
       		<h:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
   		</h:form>
  -
  -	</s:decorateAll>
  +	</div>
   		
   </div>
   
  
  
  
  1.16      +9 -8      jboss-seam/examples/booking/view/hotel.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: hotel.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/booking/view/hotel.xhtml,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- hotel.xhtml	18 Mar 2007 20:18:41 -0000	1.15
  +++ hotel.xhtml	20 Mar 2007 21:34:25 -0000	1.16
  @@ -15,15 +15,16 @@
   
   <div class="section">
   	<ui:include src="hotelview.xhtml"/>
  -	<div class="entry">
  -		<div class="input">
  +
  +	<div class="buttonBox">
   			<h:form id="hotel">
   				<h:commandButton id="bookHotel" action="#{hotelBooking.bookHotel}" value="Book Hotel"/>
   				&#160;
   				<h:commandButton id="cancel" action="#{hotelBooking.cancel}" value="Back to Search"/>
   			</h:form>
   		</div>
  -	</div>
  +			
  +
   </div>
   
   </ui:define>
  
  
  
  1.25      +37 -46    jboss-seam/examples/booking/view/register.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: register.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/booking/view/register.xhtml,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -b -r1.24 -r1.25
  --- register.xhtml	18 Mar 2007 20:22:45 -0000	1.24
  +++ register.xhtml	20 Mar 2007 21:34:25 -0000	1.25
  @@ -54,52 +54,43 @@
                   <h:form id="registration">
   				<fieldset>
   				
  -                    <s:validateAll>
  -                      <s:decorateAll rowClass="entry" 
  -                                     labelColumnClass="label" 
  -                                     fieldColumnClass="input"
  -                                     messageColumnClass="errors"
  -                                     id="registrationFields">
  -
  -                       <f:facet name="aroundInvalidField">
  -                           <s:span styleClass="errors"/>
  -                       </f:facet>
  -                       <f:facet name="message">
  -                           <s:div styleClass="errors">
  -               	               <s:message/>
  -               	           </s:div>
  -                       </f:facet>
  -		    
  -						<s:decorate id="usernameDecorate">
  -							<f:facet name="label">Username:</f:facet>
  +					<s:decorate id="usernameDecorate" template="edit.xhtml">
  +						<ui:define name="label">Username:</ui:define>
  +						<ui:define name="input">
   							<h:inputText id="username" value="#{user.username}" required="true">
   								<a:support event="onblur" reRender="usernameDecorate"/>
   							</h:inputText>
  +						</ui:define>
   						</s:decorate>
   						
  -						<s:decorate id="nameDecorate">
  -							<f:facet name="label">Real Name:</f:facet>
  +					<s:decorate id="nameDecorate" template="edit.xhtml">
  +						<ui:define name="label">Real Name:</ui:define>
  +						<ui:define name="input">
   							<h:inputText id="name" value="#{user.name}" required="true">
   								<a:support event="onblur" reRender="nameDecorate"/>
   							</h:inputText>
  +						</ui:define>
  +					</s:decorate>
  +					
  +					<s:decorate id="passwordDecorate" template="edit.xhtml">
  +						<ui:define name="label">Password:</ui:define>
  +						<ui:define name="input">
  +						<h:inputSecret id="password" value="#{user.password}" required="true"/>
  +						</ui:define>
   						</s:decorate>
   						
  -						<h:inputSecret id="password" value="#{user.password}" required="true">
  -							<f:facet name="label">Password:</f:facet>
  -						</h:inputSecret>
  -						
  -						<h:inputSecret id="verify" value="#{register.verify}" required="true">
  -							<f:facet name="label">Verify Password:</f:facet>
  -						</h:inputSecret>
  +					<s:decorate id="verifyDecorate" template="edit.xhtml">
  +						<ui:define name="label">Verify Password:</ui:define>
  +						<ui:define name="input">
  +						<h:inputSecret id="verify" value="#{register.verify}" required="true"/>
  +						</ui:define>
  +					</s:decorate>
   						
  -						<s:fragment>
  +					<div class="buttonBox">
   							<h:commandButton id="register" value="Register" action="#{register.register}"/>
   							&#160;
   							<s:button id="cancel" value="Cancel" view="/home.xhtml"/>
  -						</s:fragment>
  -						
  -					  </s:decorateAll>
  -					</s:validateAll>
  +					</div>
   									
   				</fieldset>
                   </h:form>
  
  
  
  1.1      date: 2007/03/20 21:34:25;  author: gavin;  state: Exp;jboss-seam/examples/booking/view/display.xhtml
  
  Index: display.xhtml
  ===================================================================
  <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 name="value"/>
          </span>
      </div>
      
  </ui:composition>
  
  
  1.1      date: 2007/03/20 21:34:25;  author: gavin;  state: Exp;jboss-seam/examples/booking/view/edit.xhtml
  
  Index: edit.xhtml
  ===================================================================
  <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">
          <s:label styleClass="label #{invalid?'errors':''}">
              <ui:insert name="label"/>
              <s:span styleClass="required" rendered="#{required}">*</s:span>
          </s:label>
          <span class="input #{invalid?'errors':''}">
              <s:validateAll>
                  <ui:insert name="input"/>
              </s:validateAll>
          </span>
          <s:message styleClass="error errors"/>
      </div>
      
  </ui:composition>
  
  
  1.1      date: 2007/03/20 21:34:25;  author: gavin;  state: Exp;jboss-seam/examples/booking/view/hotelview.xhtml
  
  Index: hotelview.xhtml
  ===================================================================
  <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"
                   rowClass="entry" 
                   labelColumnClass="label" 
                   fieldColumnClass="output"
                   id="hotels">
      
      <s:decorate template="display.xhtml">             
  		<ui:define name="label">Name:</ui:define>
  		<ui:define name="value">#{hotel.name}</ui:define>
  	</s:decorate>
  	
      <s:decorate template="display.xhtml">             
  		<ui:define name="label">Address:</ui:define>
  		<ui:define name="value">#{hotel.address}</ui:define>
  	</s:decorate>
  	
      <s:decorate template="display.xhtml">             
  		<ui:define name="label">City:</ui:define>
  		<ui:define name="value">#{hotel.city}</ui:define>
  	</s:decorate>
  	
      <s:decorate template="display.xhtml">             
  		<ui:define name="label">State:</ui:define>
  		<ui:define name="value">#{hotel.state}</ui:define>
  	</s:decorate>
  	
      <s:decorate template="display.xhtml">             
  		<ui:define name="label">Zip:</ui:define>
  		<ui:define name="value">#{hotel.zip}</ui:define>
  	</s:decorate>
  	
      <s:decorate template="display.xhtml">             
  		<ui:define name="label">Country:</ui:define>
  		<ui:define name="value">#{hotel.country}</ui:define>
  	</s:decorate>
  	
      <s:decorate template="display.xhtml">             
  		<ui:define name="label">Nightly rate:</ui:define>
  		<ui:define name="value">
  			<h:outputText value="#{hotel.name}">
  				<f:convertNumber type="currency" currencySymbol="$"/>
  			</h:outputText>
  		</ui:define>
  	</s:decorate>
  	  
  </ui:composition>
  
  
  



More information about the jboss-cvs-commits mailing list