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

Gavin King gavin.king at jboss.com
Mon Oct 2 01:29:45 EDT 2006


  User: gavin   
  Date: 06/10/02 01:29:45

  Modified:    examples/booking/view      book.xhtml confirm.xhtml
                        hotel.xhtml password.xhtml register.xhtml
  Log:
  use s:decorate
  
  Revision  Changes    Path
  1.12      +84 -50    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.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- book.xhtml	4 May 2006 23:41:18 -0000	1.11
  +++ book.xhtml	2 Oct 2006 05:29:44 -0000	1.12
  @@ -36,62 +36,95 @@
   		</div>
   		
   		<s:validateAll>
  +		
  +		    <f:facet name="afterInvalidField">
  +		       <s:message/>
  +		    </f:facet>
  +		    <f:facet name="aroundInvalidField">
  +		       <s:span styleClass="errors"/>
  +		    </f:facet>
  +		    
   			<div class="entry">
   				<div class="label"><h:outputLabel for="checkinDate">Check In Date:</h:outputLabel></div>
   				<div class="input">
  +					<s:decorate>
   					<h:inputText id="checkinDate" value="#{booking.checkinDate}" required="true">
   						<f:convertDateTime type="date"/>
   					</h:inputText>
  -					<br/><span class="errors"><h:message for="checkinDate" /></span>
  +						<br/>
  +					</s:decorate>
   				</div>
   			</div>
  +			
   			<div class="entry">
   				<div class="label"><h:outputLabel for="checkoutDate">Check Out Date:</h:outputLabel></div>
   				<div class="input">
  +					<s:decorate>
   					<h:inputText id="checkoutDate" value="#{booking.checkoutDate}" required="true">
   						<f:convertDateTime type="date"/>
   					</h:inputText>
  -					<br/><span class="errors"><h:message for="checkoutDate" /></span>
  +						<br/>
  +					</s:decorate>
   				</div>
   			</div>
  +			
   			<div class="entry">
   				<div class="label"><h:outputLabel for="beds">Room Preference:</h:outputLabel></div>
   				<div class="input">
  +					<s:decorate>
   				   <h:selectOneMenu id="beds" value="#{booking.beds}">
   				      <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>
  -				   <br/><span class="errors"><h:message for="beds"/></span>
  +						<br/>
  +					</s:decorate>
   				</div>
   			</div>
  +			
   			<div class="entry">
   				<div class="label"><h:outputLabel for="smoking">Smoking Preference:</h:outputLabel></div>
   				<div id="radio" class="input">
  +					<s:decorate>
   				   <h:selectOneRadio id="smoking" value="#{booking.smoking}" layout="vertical">
   				      <f:selectItem itemLabel="Smoking" itemValue="true"/>
   				      <f:selectItem itemLabel="Non Smoking" itemValue="false"/>
   	               </h:selectOneRadio>
   				   <br/>
  +					</s:decorate>
   				</div>
   			</div>
  +			
   			<div class="entry">
   				<div class="label"><h:outputLabel for="creditCard">Credit Card #:</h:outputLabel></div>
   				<div class="input">
  +					<s:decorate>
   				   <h:inputText id="creditCard" value="#{booking.creditCard}" required="true"/>
  -				   <br/><span class="errors"><h:message for="creditCard" /></span>
  +						<br/>
  +					</s:decorate>
   				</div>
   			</div>
  +			
   			<div class="entry">
   				<div class="label"><h:outputLabel for="creditCardName">Credit Card Name:</h:outputLabel></div>
   				<div class="input">
  +					<s:decorate>
   				   <h:inputText id="creditCardName" value="#{booking.creditCardName}" required="true"/>
  -				   <br/><span class="errors"><h:message for="creditCardName" /></span>
  +						<br/>
  +					</s:decorate>
   				</div>
   			</div>
  +			
   			<div class="entry">
   				<div class="label"><h:outputLabel for="creditCardExpiryMonth">Credit Card Expiry:</h:outputLabel></div>
   				<div class="input">
  +					<s:decorate>
  +						<f:facet name="afterInvalidField">
  +							<f:subview>
  +								<h:message for="creditCardExpiryMonth" />
  +								<h:message for="creditCardExpiryYear" />
  +							</f:subview>
  +						</f:facet>
   				   <h:selectOneMenu id="creditCardExpiryMonth" value="#{booking.creditCardExpiryMonth}">
   				      <f:selectItem itemLabel="Jan" itemValue="1"/>
   				      <f:selectItem itemLabel="Feb" itemValue="2"/>
  @@ -114,15 +147,16 @@
   				      <f:selectItem itemLabel="2009" itemValue="2009"/>
   				   </h:selectOneMenu>
   				   <br/>
  -				   <span class="errors">
  -				      <h:message for="creditCardExpiryMonth" />
  -				      <h:message for="creditCardExpiryYear" />
  -				   </span>
  +					</s:decorate>
   				</div>
   			</div>
  +			
   		</s:validateAll>
   		
  -		<div class="entry errors"><h:messages globalOnly="true"/></div>
  +		<div class="entry errors">
  +			<h:messages globalOnly="true"/>
  +		</div>
  +		
   		<div class="entry">
   			<div class="label"><f:verbatim>&#160;</f:verbatim></div>
   			<div class="input">
  
  
  
  1.10      +3 -3      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.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- confirm.xhtml	28 Sep 2006 01:16:06 -0000	1.9
  +++ confirm.xhtml	2 Oct 2006 05:29:44 -0000	1.10
  @@ -49,9 +49,9 @@
   		<div class="entry">
   			<div class="label">&#160;</div>
   			<div class="input">
  -				<s:commandButton value="Confirm" action="#{hotelBooking.confirm}" class="button"/>&#160;
  -    			<s:commandButton value="Revise" action="back" class="button"/>&#160;
  -    			<s:commandButton value="Cancel" action="#{hotelBooking.cancel}" class="button"/>
  +				<h:commandButton value="Confirm" action="#{hotelBooking.confirm}" class="button"/>&#160;
  +    			<h:commandButton value="Revise" action="back" class="button"/>&#160;
  +    			<h:commandButton value="Cancel" action="#{hotelBooking.cancel}" class="button"/>
   			</div>
   		</div>
   	</fieldset>
  
  
  
  1.9       +2 -2      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.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- hotel.xhtml	28 Sep 2006 01:16:06 -0000	1.8
  +++ hotel.xhtml	2 Oct 2006 05:29:44 -0000	1.9
  @@ -40,8 +40,8 @@
   <div class="section">
   	<h:form>
   	<fieldset class="buttonBox">
  -		<s:commandButton action="#{hotelBooking.bookHotel}" value="Book Hotel" class="button"/>&#160;
  -		<s:commandButton action="#{hotelBooking.cancel}" value="Back to Search" class="button"/>
  +		<h:commandButton action="#{hotelBooking.bookHotel}" value="Book Hotel" class="button"/>&#160;
  +		<h:commandButton action="#{hotelBooking.cancel}" value="Back to Search" class="button"/>
   	</fieldset>
   	</h:form>
   </div>
  
  
  
  1.6       +43 -23    jboss-seam/examples/booking/view/password.xhtml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: password.xhtml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/booking/view/password.xhtml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- password.xhtml	1 May 2006 03:24:03 -0000	1.5
  +++ password.xhtml	2 Oct 2006 05:29:44 -0000	1.6
  @@ -13,24 +13,42 @@
   </div>
   <div class="section">
   	<h:form>
  +	
  +	    <f:facet name="afterInvalidField">
  +	       <s:message/>
  +	    </f:facet>
  +	    <f:facet name="aroundInvalidField">
  +	       <s:span styleClass="errors"/>
  +	    </f:facet>
  +		    
   	<fieldset>
  +		
   		<div class="entry">
   			<div class="label"><h:outputLabel for="password">Password:</h:outputLabel></div>
   			<div class="input">
  +					<s:decorate>
   				<h:inputSecret id="password" value="#{user.password}" required="true">
   					<s:validate/>
   				</h:inputSecret>
  -				<br/><span class="errors"><h:message for="password"/></span>
  +						<br/>
  +					</s:decorate>
   			</div>
   		</div>
  +			
   		<div class="entry">
   			<div class="label"><h:outputLabel for="password">Verify:</h:outputLabel></div>
   			<div class="input">
  +					<s:decorate>
   				<h:inputSecret id="verify" value="#{changePassword.verify}" required="true"/>
  -				<br/><span class="errors"><h:message for="verify"/></span>
  +						<br/>
  +					</s:decorate>
   			</div>
   		</div>
  -		<div class="entry errors"><h:messages globalOnly="true"/></div>
  +			
  +			<div class="entry errors">
  +				<h:messages globalOnly="true"/>
  +			</div>
  +			
   		<div class="entry">
   			<div class="label">&#160;</div>
   			<div class="input">
  @@ -38,7 +56,9 @@
   				<s:link value="Cancel" action="#{changePassword.cancel}" linkStyle="button" buttonClass="button"/>
   			</div>
   		</div>
  +			
   	</fieldset>
  +		
   	</h:form>
   </div>
   </ui:define>
  
  
  
  1.9       +29 -9     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.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- register.xhtml	4 May 2006 23:41:18 -0000	1.8
  +++ register.xhtml	2 Oct 2006 05:29:44 -0000	1.9
  @@ -2,6 +2,7 @@
   <html 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">
   <head>
   	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  @@ -40,37 +41,56 @@
   				<fieldset>
   				
   					<s:validateAll>
  +
  +					    <f:facet name="afterInvalidField">
  +					       <s:message/>
  +					    </f:facet>
  +					    <f:facet name="aroundInvalidField">
  +					       <s:span styleClass="errors"/>
  +					    </f:facet>
  +		    
   						<div class="entry">
   							<div class="label"><h:outputLabel for="username">Username:</h:outputLabel></div>
   							<div class="input">
  +								<s:decorate>
   								<h:inputText id="username" value="#{user.username}" required="true"/><br/>
  -								<span class="errors"><h:message for="username" /></span>
  +								</s:decorate>
   							</div>
   						</div>
  +						
   						<div class="entry">
   							<div class="label"><h:outputLabel for="name">Real Name:</h:outputLabel></div>
   							<div class="input">
  +								<s:decorate>
   								<h:inputText id="name" value="#{user.name}" required="true"/><br/>
  -								<span class="errors"><h:message for="name" /></span>
  +								</s:decorate>
   							</div>
   						</div>
  +						
   						<div class="entry">
   							<div class="label"><h:outputLabel for="password">Password:</h:outputLabel></div>
   							<div class="input">
  +								<s:decorate>
   								<h:inputSecret id="password" value="#{user.password}" required="true"/><br/>
  -								<span class="errors"><h:message for="password" /></span>
  +								</s:decorate>
   							</div>
   						</div>
  +						
   						<div class="entry">
   							<div class="label"><h:outputLabel for="verify">Verify Password:</h:outputLabel></div>
   							<div class="input">
  +								<s:decorate>
   								<h:inputSecret id="verify" value="#{register.verify}" required="true"/><br/>
  -								<span class="errors"><h:message for="verify" /></span>
  +								</s:decorate>
   							</div>
   						</div>
  +
   					</s:validateAll>
   					
  -					<div class="entry errors"><h:messages globalOnly="true" /></div>
  +					<div class="entry errors">
  +						<h:messages globalOnly="true"/>
  +					</div>
  +					
   					<div class="entry">
   						<div class="label">&#160;</div>
   						<div class="input">
  
  
  



More information about the jboss-cvs-commits mailing list