[jboss-cvs] jboss-seam/examples/booking/view ...
Gavin King
gavin.king at jboss.com
Fri Feb 16 21:56:46 EST 2007
User: gavin
Date: 07/02/16 21:56:46
Modified: examples/booking/view book.xhtml register.xhtml
Log:
better ajax validation
Revision Changes Path
1.29 +14 -20 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.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- book.xhtml 15 Dec 2006 13:26:32 -0000 1.28
+++ book.xhtml 17 Feb 2007 02:56:46 -0000 1.29
@@ -50,20 +50,23 @@
<f:facet name="aroundInvalidField">
<s:span styleClass="errors"/>
</f:facet>
+ <f:facet name="afterInvalidField">
+ <s:div styleClass="errors">
+ <s:message/>
+ </s:div>
+ </f:facet>
<div class="entry">
<div class="label"><h:outputLabel for="checkinDate">Check In Date:</h:outputLabel></div>
<div class="input">
- <s:decorate>
+ <s:decorate id="checkinDateDecorate">
<h:inputText id="checkinDate" value="#{booking.checkinDate}" required="true">
<s:convertDateTime pattern="MM/dd/yyyy"/>
- <a:support event="onblur" reRender="checkinDateErrors"/>
+ <a:support event="onblur" reRender="checkinDateDecorate"/>
</h:inputText>
<s:selectDate for="checkinDate">
<h:graphicImage url="img/dtpick.gif" style="margin-left:5px"/>
</s:selectDate>
- <br/>
- <a:outputPanel id="checkinDateErrors"><s:message/></a:outputPanel>
</s:decorate>
</div>
</div>
@@ -71,16 +74,14 @@
<div class="entry">
<div class="label"><h:outputLabel for="checkoutDate">Check Out Date:</h:outputLabel></div>
<div class="input">
- <s:decorate>
+ <s:decorate id="checkoutDateDecorate">
<h:inputText id="checkoutDate" value="#{booking.checkoutDate}" required="true">
<s:convertDateTime pattern="MM/dd/yyyy"/>
- <a:support event="onblur" reRender="checkoutDateErrors"/>
+ <a:support event="onblur" reRender="checkoutDateDecorate"/>
</h:inputText>
<s:selectDate for="checkoutDate">
<h:graphicImage url="img/dtpick.gif" style="margin-left:5px"/>
</s:selectDate>
- <br/>
- <a:outputPanel id="checkoutDateErrors"><s:message/></a:outputPanel>
</s:decorate>
</div>
</div>
@@ -94,7 +95,6 @@
<f:selectItem itemLabel="Two double beds" itemValue="2"/>
<f:selectItem itemLabel="Three beds" itemValue="3"/>
</h:selectOneMenu>
- <br/>
</s:decorate>
</div>
</div>
@@ -107,7 +107,6 @@
<f:selectItem itemLabel="Smoking" itemValue="true"/>
<f:selectItem itemLabel="Non Smoking" itemValue="false"/>
</h:selectOneRadio>
- <br/>
</s:decorate>
</div>
</div>
@@ -115,12 +114,10 @@
<div class="entry">
<div class="label"><h:outputLabel for="creditCard">Credit Card #:</h:outputLabel></div>
<div class="input">
- <s:decorate>
+ <s:decorate id="creditCardDecorate">
<h:inputText id="creditCard" value="#{booking.creditCard}" required="true">
- <a:support event="onblur" reRender="creditCardErrors"/>
+ <a:support event="onblur" reRender="creditCardDecorate"/>
</h:inputText>
- <br/>
- <a:outputPanel id="creditCardErrors"><s:message/></a:outputPanel>
</s:decorate>
</div>
</div>
@@ -128,12 +125,10 @@
<div class="entry">
<div class="label"><h:outputLabel for="creditCardName">Credit Card Name:</h:outputLabel></div>
<div class="input">
- <s:decorate>
+ <s:decorate id="creditCardNameDecorate">
<h:inputText id="creditCardName" value="#{booking.creditCardName}" required="true">
- <a:support event="onblur" reRender="creditCardNameErrors"/>
+ <a:support event="onblur" reRender="creditCardNameDecorate"/>
</h:inputText>
- <br/>
- <a:outputPanel id="creditCardNameErrors"><s:message/></a:outputPanel>
</s:decorate>
</div>
</div>
@@ -163,7 +158,6 @@
<f:selectItem itemLabel="2008" itemValue="2008"/>
<f:selectItem itemLabel="2009" itemValue="2009"/>
</h:selectOneMenu>
- <br/>
</s:decorate>
</div>
</div>
1.21 +13 -16 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.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- register.xhtml 17 Dec 2006 13:12:56 -0000 1.20
+++ register.xhtml 17 Feb 2007 02:56:46 -0000 1.21
@@ -47,16 +47,19 @@
<f:facet name="aroundInvalidField">
<s:span styleClass="errors"/>
</f:facet>
+ <f:facet name="afterInvalidField">
+ <s:div styleClass="errors">
+ <s:message/>
+ </s:div>
+ </f:facet>
<div class="entry">
<div class="label"><h:outputLabel for="username">Username:</h:outputLabel></div>
<div class="input">
- <s:decorate>
+ <s:decorate id="usernameDecorate">
<h:inputText id="username" value="#{user.username}" required="true">
- <a:support event="onblur" reRender="usernameErrors"/>
+ <a:support event="onblur" reRender="usernameDecorate"/>
</h:inputText>
- <br/>
- <a:outputPanel id="usernameErrors"><s:message/></a:outputPanel>
</s:decorate>
</div>
</div>
@@ -64,12 +67,10 @@
<div class="entry">
<div class="label"><h:outputLabel for="name">Real Name:</h:outputLabel></div>
<div class="input">
- <s:decorate>
+ <s:decorate id="nameDecorate">
<h:inputText id="name" value="#{user.name}" required="true">
- <a:support event="onblur" reRender="nameErrors"/>
+ <a:support event="onblur" reRender="nameDecorate"/>
</h:inputText>
- <br/>
- <a:outputPanel id="nameErrors"><s:message/></a:outputPanel>
</s:decorate>
</div>
</div>
@@ -79,8 +80,6 @@
<div class="input">
<s:decorate>
<h:inputSecret id="password" value="#{user.password}" required="true"/>
- <br/>
- <h:message for="password"/>
</s:decorate>
</div>
</div>
@@ -90,8 +89,6 @@
<div class="input">
<s:decorate>
<h:inputSecret id="verify" value="#{register.verify}" required="true"/>
- <br/>
- <h:message for="verify"/>
</s:decorate>
</div>
</div>
More information about the jboss-cvs-commits
mailing list