[jboss-cvs] jboss-seam/examples/nestedbooking/view ...
Peter Muir
peter at bleepbleep.org.uk
Sun Nov 25 08:12:01 EST 2007
User: pmuir
Date: 07/11/25 08:12:01
Added: examples/nestedbooking/view confirm.xhtml
register.xhtml conversations.xhtml hotel.xhtml
index.html payment.xhtml home.xhtml template.xhtml
output.xhtml password.xhtml rooms.xhtml book.xhtml
edit.xhtml main.xhtml
Log:
JBSEAM-2293 - nested conversations example - thanks to Jacob Orshalick
Revision Changes Path
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/confirm.xhtml
Index: confirm.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"
template="template.xhtml">
<!-- content -->
<ui:define name="content">
<div class="section">
<h1>Confirm Hotel Booking</h1>
</div>
<div class="section">
<h:form id="confirm">
<fieldset>
<s:decorate template="output.xhtml">
<ui:define name="label">Name:</ui:define>
#{hotel.name}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Address:</ui:define>
#{hotel.address}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">City, State:</ui:define>
#{hotel.city}, #{hotel.state}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Zip:</ui:define>
#{hotel.zip}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Country:</ui:define>
#{hotel.country}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Room Preference:</ui:define>
#{roomSelection.name}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Total payment:</ui:define>
<h:outputText value="#{roomPreference.expectedPrice}">
<f:convertNumber type="currency"
currencySymbol="$"/>
</h:outputText>
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Check In Date:</ui:define>
<h:outputText value="#{booking.checkinDate}"/>
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Check Out Date:</ui:define>
<h:outputText value="#{booking.checkoutDate}"/>
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Credit Card #:</ui:define>
#{booking.creditCard}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label"> </ui:define>
<h:commandButton id="confirm" value="Confirm" action="#{hotelBooking.confirm}"/> 
<s:button id="revise" value="Revise" view="/payment.xhtml"/> 
<h:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
</s:decorate>
</fieldset>
</h:form>
</div>
</ui:define>
<!-- sidebar -->
<ui:define name="sidebar"></ui:define>
</ui:composition>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/register.xhtml
Index: register.xhtml
===================================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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"
xmlns:a="https://ajax4jsf.dev.java.net/ajax">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>JBoss Suites: Seam Framework</title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />
</head>
<body id="pgHome">
<div id="document">
<div id="header">
<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
</div>
<div id="container">
<div id="sidebar"></div>
<div id="content">
<div class="section">
<h1>Register</h1>
</div>
<div class="section">
<h:form id="register">
<fieldset>
<s:decorate template="edit.xhtml" id="usernameDecorate">
<ui:define name="label">Username:</ui:define>
<h:inputText id="username" value="#{user.username}" required="true">
<a:support event="onblur" reRender="usernameDecorate"/>
</h:inputText>
</s:decorate>
<s:decorate template="edit.xhtml" id="nameDecorate">
<ui:define name="label">Real Name:</ui:define>
<h:inputText id="name" value="#{user.name}" required="true">
<a:support event="onblur" reRender="nameDecorate"/>
</h:inputText>
</s:decorate>
<s:decorate template="edit.xhtml">
<ui:define name="label">Password:</ui:define>
<h:inputSecret id="password" value="#{user.password}" required="true"/>
</s:decorate>
<s:decorate template="edit.xhtml">
<ui:define name="label">Verify Password:</ui:define>
<h:inputSecret id="verify" value="#{register.verify}" required="true"/>
</s:decorate>
<div class="entry errors">
<h:messages globalOnly="true"/>
</div>
<div class="entry">
<div class="label"> </div>
<div class="input">
<h:commandButton id="register" value="Register" action="#{register.register}"/> 
<s:button id="cancel" value="Cancel" view="/home.xhtml"/>
</div>
</div>
</fieldset>
</h:form>
</div>
</div>
</div>
<div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
</div>
</body>
</html>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/conversations.xhtml
Index: conversations.xhtml
===================================================================
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jstl/core"
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:s="http://jboss.com/products/seam/taglib">
<div class="section">
<h1><h:outputText rendered="#{not empty conversationList}" value="Workspaces"/></h1>
</div>
<div class="section">
<h:form>
<h:dataTable value="#{conversationList}" var="entry">
<h:column>
<h:commandLink action="#{entry.select}" value="#{entry.description}"/>
 
<h:outputText value="[current]" rendered="#{entry.current}"/>
</h:column>
<h:column>
<h:outputText value="#{entry.startDatetime}">
<s:convertDateTime type="time" pattern="hh:mm"/>
</h:outputText>
-
<h:outputText value="#{entry.lastDatetime}">
<s:convertDateTime type="time" pattern="hh:mm"/>
</h:outputText>
</h:column>
</h:dataTable>
</h:form>
</div>
</div>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/hotel.xhtml
Index: hotel.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"
template="template.xhtml">
<!-- content -->
<ui:define name="content">
<div class="section">
<h1>View Hotel</h1>
</div>
<div class="section">
<s:decorate template="output.xhtml">
<ui:define name="label">Name:</ui:define>
#{hotel.name}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Address:</ui:define>
#{hotel.address}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">City, State:</ui:define>
#{hotel.city}, #{hotel.state}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Zip:</ui:define>
#{hotel.zip}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Country:</ui:define>
#{hotel.country}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Nightly rate:</ui:define>
<h:outputText value="#{hotel.minPrice}">
<f:convertNumber type="currency"
currencySymbol="$"/>
</h:outputText>
-
<h:outputText value="#{hotel.maxPrice}">
<f:convertNumber type="currency"
currencySymbol="$"/>
</h:outputText>
</s:decorate>
</div>
<div class="section">
<h:form id="hotel">
<fieldset class="buttonBox">
<h:commandButton id="bookHotel" action="#{hotelBooking.bookHotel}" value="Book Hotel"/> 
<h:commandButton id="cancel" action="#{hotelBooking.cancel}" value="Back to Search"/>
</fieldset>
</h:form>
</div>
</ui:define>
<!-- sidebar -->
<ui:define name="sidebar"></ui:define>
</ui:composition>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/index.html
Index: index.html
===================================================================
<html>
<head>
<meta http-equiv="Refresh" content="0; URL=home.seam">
</head>
</html>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/payment.xhtml
Index: payment.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"
xmlns:a="https://ajax4jsf.dev.java.net/ajax"
template="template.xhtml">
<!-- content -->
<ui:define name="content">
<div class="section">
<h1>Payment</h1>
</div>
<div class="section">
<h:form id="payment">
<fieldset>
<s:decorate template="output.xhtml">
<ui:define name="label">Name:</ui:define>
#{hotel.name}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Address:</ui:define>
#{hotel.address}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">City, State:</ui:define>
#{hotel.city}, #{hotel.state}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Zip:</ui:define>
#{hotel.zip}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Country:</ui:define>
#{hotel.country}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Room Preference:</ui:define>
#{roomSelection.name}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Total payment:</ui:define>
<h:outputText value="#{roomPreference.expectedPrice}">
<f:convertNumber type="currency"
currencySymbol="$"/>
</h:outputText>
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Check In Date:</ui:define>
<h:outputText value="#{booking.checkinDate}"/>
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Check Out Date:</ui:define>
<h:outputText value="#{booking.checkoutDate}"/>
</s:decorate>
<s:decorate template="edit.xhtml" id="creditCardDecorate">
<ui:define name="label">Credit Card #:</ui:define>
<h:inputText id="creditCard" value="#{booking.creditCard}" required="true">
<a:support event="onblur" reRender="creditCardDecorate"/>
</h:inputText>
</s:decorate>
<s:decorate template="edit.xhtml" id="creditCardNameDecorate">
<ui:define name="label">Credit Card Name:</ui:define>
<h:inputText id="creditCardName" value="#{booking.creditCardName}" required="true">
<a:support event="onblur" reRender="creditCardNameDecorate"/>
</h:inputText>
</s:decorate>
<s:decorate template="edit.xhtml">
<ui:define name="label">Credit Card Expiry:</ui:define>
<h:selectOneMenu id="creditCardExpiryMonth" value="#{booking.creditCardExpiryMonth}">
<f:selectItem itemLabel="Jan" itemValue="1"/>
<f:selectItem itemLabel="Feb" itemValue="2"/>
<f:selectItem itemLabel="Mar" itemValue="3"/>
<f:selectItem itemLabel="Apr" itemValue="4"/>
<f:selectItem itemLabel="May" itemValue="5"/>
<f:selectItem itemLabel="Jun" itemValue="6"/>
<f:selectItem itemLabel="Jul" itemValue="7"/>
<f:selectItem itemLabel="Aug" itemValue="8"/>
<f:selectItem itemLabel="Sep" itemValue="9"/>
<f:selectItem itemLabel="Oct" itemValue="10"/>
<f:selectItem itemLabel="Nov" itemValue="11"/>
<f:selectItem itemLabel="Dec" itemValue="12"/>
</h:selectOneMenu>
<h:selectOneMenu id="creditCardExpiryYear" value="#{booking.creditCardExpiryYear}">
<f:selectItem itemLabel="2005" itemValue="2005"/>
<f:selectItem itemLabel="2006" itemValue="2006"/>
<f:selectItem itemLabel="2007" itemValue="2007"/>
<f:selectItem itemLabel="2008" itemValue="2008"/>
<f:selectItem itemLabel="2009" itemValue="2009"/>
</h:selectOneMenu>
</s:decorate>
</fieldset>
<div class="entry errors">
<h:messages globalOnly="true"/>
</div>
<div class="entry">
<div class="label"> </div>
<div class="input">
<h:commandButton id="proceed" value="Proceed" action="#{roomPreference.requestConfirmation}"/> 
<s:button id="cancel" value="Revise Room" action="#{roomPreference.cancel}"/>
</div>
</div>
</h:form>
</div>
</ui:define>
<!-- sidebar -->
<ui:define name="sidebar">
<h1>Nesting conversations</h1>
<p>Nested conversations allow the application to capture a consistent continuable state at various points in a user interaction, thus insuring truly correct behavior in the face of backbuttoning and workspace management.</p>
<p><b>Continuing the conversation</b></p>
<p>Try going back and selecting a different room. You will notice a new nested conversation in the list of workspace entries. Each nested conversation is associated with the specific room selected ensuring consistent behavior.</p>
</ui:define>
</ui:composition>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/home.xhtml
Index: home.xhtml
===================================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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" />
<title>JBoss Suites: Seam Framework</title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />
</head>
<body id="pgHome">
<f:view>
<div id="document">
<div id="header">
<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
</div>
<div id="container">
<div id="sidebar">
<h:form id="login">
<fieldset>
<div>
<h:outputLabel for="username">Login Name</h:outputLabel>
<h:inputText id="username" value="#{identity.username}" style="width: 175px;"/>
<div class="errors"><h:message for="username"/></div>
</div>
<div>
<h:outputLabel for="password">Password</h:outputLabel>
<h:inputSecret id="password" value="#{identity.password}" style="width: 175px;"/>
</div>
<div class="errors"><h:messages globalOnly="true"/></div>
<div class="buttonBox"><h:commandButton id="login" action="#{identity.login}" value="Account Login"/></div>
<div class="notes"><s:link id="register" view="/register.xhtml" value="Register New User"/></div>
</fieldset>
</h:form>
</div>
<div id="content">
</div>
</div>
<div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
</div>
</f:view>
</body>
</html>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/template.xhtml
Index: template.xhtml
===================================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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:s="http://jboss.com/products/seam/taglib">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>JBoss Suites: Seam Framework</title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />
<link href="css/date.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="document">
<div id="header">
<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
<div id="status">
Welcome #{user.name}
| <s:link id="search" view="/main.xhtml" value="Search" propagation="none"/>
| <s:link id="settings" view="/password.xhtml" value="Settings" propagation="none"/>
| <s:link id="logout" action="#{identity.logout}" value="Logout"/>
</div>
</div>
<div id="container">
<div id="sidebar">
<ui:insert name="sidebar"/>
</div>
<div id="content">
<ui:insert name="content"/>
<ui:include src="conversations.xhtml" />
</div>
</div>
<div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
</div>
</body>
</html>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/output.xhtml
Index: output.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 class="entry">
<div class="label">
<ui:insert name="label"/>
</div>
<div class="output">
<ui:insert/>
</div>
</div>
</ui:composition>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/password.xhtml
Index: password.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"
template="template.xhtml">
<!-- content -->
<ui:define name="content">
<div class="section">
<h1>Change Your Password</h1>
</div>
<div class="section">
<h:form id="setpassword">
<fieldset>
<s:decorate template="edit.xhtml">
<ui:define name="label">Password</ui:define>
<h:inputSecret id="password" value="#{user.password}" required="true" />
</s:decorate>
<s:decorate template="edit.xhtml">
<ui:define name="label">Verify:</ui:define>
<h:inputSecret id="verify" value="#{changePassword.verify}" required="true"/>
</s:decorate>
<div class="entry errors">
<h:messages globalOnly="true"/>
</div>
<div class="entry">
<div class="label"> </div>
<div class="input">
<h:commandButton id="change" value="Change" action="#{changePassword.changePassword}"/> 
<s:button id="cancel" value="Cancel" view="/main.xhtml"/>
</div>
</div>
</fieldset>
</h:form>
</div>
</ui:define>
<!-- sidebar -->
<ui:define name="sidebar"></ui:define>
</ui:composition>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/rooms.xhtml
Index: rooms.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"
xmlns:a="https://ajax4jsf.dev.java.net/ajax"
template="template.xhtml">
<!-- content -->
<ui:define name="content">
<div class="section">
<h1>Room Preference</h1>
</div>
<div class="section">
<h:form id="room_selections_form">
<div class="section">
<h:outputText styleClass="output" value="No rooms available for the dates selected: " rendered="#{availableRooms != null and availableRooms.rowCount == 0}"/>
<h:outputText styleClass="output" value="Rooms available for the dates selected: " rendered="#{availableRooms != null and availableRooms.rowCount > 0}"/>
<h:outputText styleClass="output" value="#{booking.checkinDate}"/> -
<h:outputText styleClass="output" value="#{booking.checkoutDate}"/>
<br/><br/>
<h:dataTable value="#{availableRooms}" var="room" rendered="#{availableRooms.rowCount > 0}">
<h:column>
<f:facet name="header">Name</f:facet>
#{room.name}
</h:column>
<h:column>
<f:facet name="header">Description</f:facet>
#{room.description}
</h:column>
<h:column>
<f:facet name="header">Per Night</f:facet>
<h:outputText value="#{room.price}">
<f:convertNumber type="currency" currencySymbol="$"/>
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
<h:commandLink id="selectRoomPreference" action="#{roomPreference.selectPreference}">Select</h:commandLink>
</h:column>
</h:dataTable>
</div>
<div class="entry">
<div class="label"> </div>
<div class="input">
<s:button id="cancel" value="Revise Dates" view="/book.xhtml"/>
</div>
</div>
</h:form>
</div>
</ui:define>
<!-- sidebar -->
<ui:define name="sidebar">
<h1>Nesting conversations</h1>
<p>Nested conversations allow the application to capture a consistent continuable state at various points in a user interaction, thus insuring truly correct behavior in the face of backbuttoning and workspace management.</p>
<p><b>How Seam manages continuable state</b></p>
<p>Seam provides a container for context state for each nested conversation. Any contextual variable in the outer conversations context will not be overwritten by a new value, the value will simply be stored in the new context container. This allows each nested conversation to maintain its own unique state.</p>
</ui:define>
</ui:composition>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/book.xhtml
Index: book.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"
xmlns:a="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
template="template.xhtml">
<!-- content -->
<ui:define name="content">
<div class="section">
<h1>Book Hotel</h1>
</div>
<div class="section">
<h:form id="booking">
<fieldset>
<s:decorate template="output.xhtml">
<ui:define name="label">Name:</ui:define>
#{hotel.name}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Address:</ui:define>
#{hotel.address}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">City, State:</ui:define>
#{hotel.city}, #{hotel.state}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Zip:</ui:define>
#{hotel.zip}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Country:</ui:define>
#{hotel.country}
</s:decorate>
<s:decorate template="output.xhtml">
<ui:define name="label">Nightly rate:</ui:define>
<h:outputText value="#{hotel.minPrice}">
<f:convertNumber type="currency"
currencySymbol="$"/>
</h:outputText>
-
<h:outputText value="#{hotel.maxPrice}">
<f:convertNumber type="currency"
currencySymbol="$"/>
</h:outputText>
</s:decorate>
<s:decorate id="checkinDateDecorate" template="edit.xhtml">
<ui:define name="label">Check In Date:</ui:define>
<rich:calendar id="checkinDate" value="#{booking.checkinDate}" required="true" datePattern="MM/dd/yyyy" event="onblur" reRender="checkinDateDecorate" />
</s:decorate>
<s:decorate id="checkoutDateDecorate" template="edit.xhtml">
<ui:define name="label">Check Out Date:</ui:define>
<rich:calendar id="checkoutDate" value="#{booking.checkoutDate}" required="true" datePattern="MM/dd/yyyy" event="onblur" reRender="checkoutDateDecorate" />
</s:decorate>
<div class="entry errors">
<h:messages globalOnly="true"/>
</div>
<div class="entry">
<div class="label"> </div>
<div class="input">
<h:commandButton id="room_preference" value="Select Room" action="#{hotelBooking.setBookingDates}"/> 
<s:button id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
</div>
</div>
</fieldset>
</h:form>
</div>
</ui:define>
<!-- sidebar -->
<ui:define name="sidebar"></ui:define>
</ui:composition>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/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 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/>
</s:validateAll>
</span>
<s:message styleClass="error errors"/>
</div>
</ui:composition>
1.1 date: 2007/11/25 13:12:01; author: pmuir; state: Exp;jboss-seam/examples/nestedbooking/view/main.xhtml
Index: main.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"
xmlns:a="https://ajax4jsf.dev.java.net/ajax"
template="template.xhtml">
<!-- content -->
<ui:define name="content">
<div class="section">
<h:form id="main">
<span class="errors">
<h:messages globalOnly="true"/>
</span>
<h1>Search Hotels</h1>
<fieldset>
<h:inputText id="searchString" value="#{hotelSearch.searchString}" style="width: 165px;">
<a:support event="onkeyup" actionListener="#{hotelSearch.find}" reRender="searchResults" />
</h:inputText>
 
<a:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" reRender="searchResults"/>
 
<a:status>
<f:facet name="start">
<h:graphicImage value="/img/spinner.gif"/>
</f:facet>
</a:status>
<br/>
<h:outputLabel for="pageSize">Maximum results:</h:outputLabel> 
<h:selectOneMenu value="#{hotelSearch.pageSize}" id="pageSize">
<f:selectItem itemLabel="5" itemValue="5"/>
<f:selectItem itemLabel="10" itemValue="10"/>
<f:selectItem itemLabel="20" itemValue="20"/>
</h:selectOneMenu>
</fieldset>
</h:form>
</div>
<a:outputPanel id="searchResults">
<div class="section">
<h:outputText value="No Hotels Found" rendered="#{hotels != null and hotels.rowCount==0}"/>
<h:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}">
<h:column>
<f:facet name="header">Name</f:facet>
#{hot.name}
</h:column>
<h:column>
<f:facet name="header">Address</f:facet>
#{hot.address}
</h:column>
<h:column>
<f:facet name="header">City, State</f:facet>
#{hot.city}, #{hot.state}, #{hot.country}
</h:column>
<h:column>
<f:facet name="header">Zip</f:facet>
#{hot.zip}
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
<s:link id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
</h:column>
</h:dataTable>
<s:link value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}"/>
</div>
</a:outputPanel>
<div class="section">
<h1>Current Hotel Bookings</h1>
</div>
<div class="section">
<h:form id="bookings">
<h:outputText value="No Bookings Found" rendered="#{bookings.rowCount==0}"/>
<h:dataTable id="bookings" value="#{bookings}" var="book" rendered="#{bookings.rowCount>0}">
<h:column>
<f:facet name="header">Name</f:facet>
#{book.hotel.name}
</h:column>
<h:column>
<f:facet name="header">Address</f:facet>
#{book.hotel.address}<br/>
#{book.hotel.city}, #{book.hotel.state}
</h:column>
<h:column>
<f:facet name="header">Check in date<br/>Check out date</f:facet>
<h:outputText value="#{book.checkinDate}"/><br/>
<h:outputText value="#{book.checkoutDate}"/>
</h:column>
<h:column>
<f:facet name="header">Room Preference</f:facet>
#{book.roomPreference.name}
</h:column>
<h:column>
<f:facet name="header">Payment</f:facet>
<h:outputText value="#{book.total}">
<f:convertNumber type="currency" currencySymbol="$"/>
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">Conf #</f:facet>
#{book.id}
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
<h:commandLink id="cancel" value="Cancel" action="#{bookingList.cancel}"/>
</h:column>
</h:dataTable>
</h:form>
</div>
</ui:define>
<!-- sidebar -->
<ui:define name="sidebar"></ui:define>
</ui:composition>
More information about the jboss-cvs-commits
mailing list