[jboss-cvs] jboss-seam/examples/icefaces/view ...
Michael Yuan
michael.yuan at jboss.com
Mon Oct 1 12:15:51 EDT 2007
User: myuan
Date: 07/10/01 12:15:51
Added: examples/icefaces/view book.xhtml confirm.xhtml
conversations.xhtml display.xhtml edit.xhtml
home.xhtml hotel.xhtml hotelview.xhtml index.html
main.xhtml password.xhtml register.xhtml
template.xhtml
Log:
icefaces booking example
Revision Changes Path
1.8 +120 -177 jboss-seam/examples/icefaces/view/book.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: book.xhtml
===================================================================
RCS file: book.xhtml
diff -N book.xhtml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ book.xhtml 1 Oct 2007 16:15:51 -0000 1.8
@@ -0,0 +1,124 @@
+<!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"
+ xmlns:ice="http://www.icesoft.com/icefaces/component"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+<div class="section">
+ <h1>Book Hotel</h1>
+</div>
+<div class="section">
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
+
+ <ui:include src="hotelview.xhtml"/>
+
+ <div style="clear:both"/>
+
+ <ice:form id="booking">
+ <fieldset>
+
+ <s:decorate id="checkinDateDecorate" template="edit.xhtml">
+ <ui:define name="label">Check In Date:</ui:define>
+ <ice:selectInputDate id="checkinDate" value="#{booking.checkinDate}"
+ renderAsPopup="true" partialSubmit="true"/>
+
+ </s:decorate>
+
+ <br/>
+ <s:decorate id="checkoutDateDecorate" template="edit.xhtml">
+ <ui:define name="label">Check Out Date:</ui:define>
+ <ice:selectInputDate id="checkoutDate" value="#{booking.checkoutDate}"
+ renderAsPopup="true" partialSubmit="true"/>
+ </s:decorate>
+ <br/>
+ <s:decorate id="bedsDecorate" template="edit.xhtml">
+ <ui:define name="label">Room Preference:</ui:define>
+ <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>
+ </s:decorate>
+
+ <s:decorate id="smokingDecorate" template="edit.xhtml">
+ <ui:define name="label">Smoking Preference:</ui:define>
+ <ice:selectOneRadio id="smoking" value="#{booking.smoking}"
+ layout="pageDirection" styleClass="radio">
+ <f:selectItem itemLabel="Smoking" itemValue="true"/>
+ <f:selectItem itemLabel="Non Smoking" itemValue="false"/>
+ </ice:selectOneRadio>
+ </s:decorate>
+
+ <s:decorate id="creditCardDecorate" template="edit.xhtml">
+ <ui:define name="label">Credit Card #:</ui:define>
+ <ice:inputText id="creditCard" value="#{booking.creditCard}"
+ required="true" partialSubmit="true"/>
+ </s:decorate>
+
+ <s:decorate id="creditCardNameDecorate" template="edit.xhtml">
+ <ui:define name="label">Credit Card Name:</ui:define>
+ <ice:inputText id="creditCardName" value="#{booking.creditCardName}"
+ partialSubmit="true" required="true"/>
+ </s:decorate>
+
+ <s:decorate id="creditCardExpiryDecorate" template="edit.xhtml">
+ <ui:define name="label">Credit Card Expiry:</ui:define>
+ <ice: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"/>
+ </ice:selectOneMenu>
+ <ice:selectOneMenu id="creditCardExpiryYear" value="#{booking.creditCardExpiryYear}">
+ <f:selectItem itemLabel="2007" itemValue="2007"/>
+ <f:selectItem itemLabel="2008" itemValue="2008"/>
+ <f:selectItem itemLabel="2009" itemValue="2009"/>
+ <f:selectItem itemLabel="2010" itemValue="2010"/>
+ <f:selectItem itemLabel="2011" itemValue="2011"/>
+ </ice:selectOneMenu>
+ </s:decorate>
+
+ <div class="buttonBox">
+ <h:commandButton id="proceed" value="Proceed" action="#{hotelBooking.setBookingDetails}"/>
+  
+ <s:button id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
+ </div>
+
+ </fieldset>
+ </ice:form>
+</div>
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+
+<h1>Workspace management</h1>
+<p>
+ As you can see, Seam makes it easy to work in multiple windows or multiple browser
+ tabs. But you can even switch between multiple tasks inside a single browser tab!
+ The "Workspaces" section showcases this advanced feature.
+</p>
+<p>
+ <a href="#" onclick="window.open('exp/workspaceExp.html','exp','width=752,height=500,scrollbars=yes');">
+ How does the workspace list work?
+ </a>
+</p>
+
+</ui:define>
+
+</ui:composition>
1.3 +40 -45 jboss-seam/examples/icefaces/view/confirm.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: confirm.xhtml
===================================================================
RCS file: confirm.xhtml
diff -N confirm.xhtml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ confirm.xhtml 1 Oct 2007 16:15:51 -0000 1.3
@@ -0,0 +1,75 @@
+<!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"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+ <h1>Confirm Hotel Booking</h1>
+</div>
+
+<div class="section">
+
+ <ui:include src="hotelview.xhtml"/>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Total Payment:</ui:define>
+ <h:outputText value="#{booking.total}">
+ <f:convertNumber type="currency" currencySymbol="$"/>
+ </h:outputText>
+ </s:decorate>
+
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Check In Date:</ui:define>
+ <h:outputText value="#{booking.checkinDate}"/>
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Check Out Date:</ui:define>
+ <h:outputText value="#{booking.checkoutDate}"/>
+ </s:decorate>
+
+ <s:decorate template="display.xhtml">
+ <ui:define name="label">Credit Card #:</ui:define>
+ #{booking.creditCard}
+ </s:decorate>
+
+ <div class="buttonBox">
+ <h:form id="confirm">
+ <h:commandButton id="confirm" value="Confirm" action="#{hotelBooking.confirm}"/>
+  
+ <s:button id="revise" value="Revise" view="/book.xhtml"/>
+  
+ <h:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
+ </h:form>
+ </div>
+
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+<h1>Back button navigation</h1>
+<p>
+ When you click "Confirm", the new booking is written to the database, the
+ conversation ends, and state associated with the conversation is automatically
+ destroyed by Seam. After you confirm your booking, try hitting the back button
+ on your web browser and clicking "Confirm" again. Seam makes it easy implement
+ applications that behave elegantly in response to the back, forward and refresh
+ buttons.
+</p>
+<p>
+ <a href="#" onclick="window.open('exp/confirmExp.html','exp','width=752,height=500,scrollbars=yes');">
+ What happens when the conversation ends?
+ </a>
+</p>
+</ui:define>
+
+</ui:composition>
1.3 +36 -34 jboss-seam/examples/icefaces/view/conversations.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: conversations.xhtml
===================================================================
RCS file: conversations.xhtml
diff -N conversations.xhtml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ conversations.xhtml 1 Oct 2007 16:15:51 -0000 1.3
@@ -0,0 +1,36 @@
+<!DOCTYPE div 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: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>
+
+ <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>
+</ui:composition>
\ No newline at end of file
1.1 date: 2007/10/01 16:15:51; author: myuan; state: Exp;jboss-seam/examples/icefaces/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/>
</span>
</div>
</ui:composition>
1.1 date: 2007/10/01 16:15:51; author: myuan; state: Exp;jboss-seam/examples/icefaces/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/>
</s:validateAll>
</span>
<s:message styleClass="error errors"/>
</div>
</ui:composition>
1.3 +63 -62 jboss-seam/examples/icefaces/view/home.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: home.xhtml
===================================================================
RCS file: home.xhtml
diff -N home.xhtml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ home.xhtml 1 Oct 2007 16:15:51 -0000 1.3
@@ -0,0 +1,74 @@
+<!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 class="section">
+
+ <h1>About this example application</h1>
+
+ <p>
+ This sample application demonstrates how easy it is to develop stateful web
+ applications using JBoss Seam. Just register, login, and book a room to see
+ Seam in action. Throughout the application you'll see popup links like
+ the ones at the bottom of this page. Click them to see how the application
+ works under the hood.
+ </p>
+
+ <p>
+ Note: Please do NOT enter personal information or your credit card number in
+ this sample application.
+ </p>
+
+ <p>
+ <a href="#" onclick="window.open('exp/introExp.html','exp','width=752,height=500,scrollbars=yes');">
+ What is JBoss Seam?
+ </a>
+ </p>
+
+ <p>
+ <a href="#" onclick="window.open('exp/loginExp.html','exp','width=752,height=500,scrollbars=yes');">
+ What happens when I login?
+ </a>
+ </p>
+
+ </div>
+ </div>
+ </div>
+ <div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
+</div>
+</f:view>
+</body>
+</html>
1.3 +14 -32 jboss-seam/examples/icefaces/view/hotel.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: hotel.xhtml
===================================================================
RCS file: hotel.xhtml
diff -N hotel.xhtml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ hotel.xhtml 1 Oct 2007 16:15:51 -0000 1.3
@@ -0,0 +1,56 @@
+<!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"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+ <h1>View Hotel</h1>
+</div>
+
+<div class="section">
+ <ui:include src="hotelview.xhtml"/>
+
+ <div class="buttonBox">
+ <h:form id="hotel">
+ <h:commandButton id="bookHotel" action="#{hotelBooking.bookHotel}" value="Book Hotel"/>
+  
+ <h:commandButton id="cancel" action="#{hotelBooking.cancel}" value="Back to Search"/>
+ </h:form>
+ </div>
+
+
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+
+<h1>Don't kill your database</h1>
+<p>
+ Keeping conversational state in memory in the middle tier is a great way to
+ improve your application's scalability. It saves hitting the database every
+ time we refresh a page, to re-read the data we were just looking at five
+ seconds ago. By using Seam's conversation context, we get a natural cache
+ of data associated with the what the user is currently doing. By nature,
+ this cache has a more efficient eviction policy than the MRU-type algorithms
+ used by a typical second-level data cache in an O/R mapping engine like
+ Hibernate (at least for some kinds of data). Of course, you should use
+ a clever combination of second-level caching and conversational data
+ caching to achieve the best performance for your application.
+</p>
+<p>
+ <a href="#" onclick="window.open('exp/bookingExp.html','exp','width=752,height=500,scrollbars=yes');">
+ How does the hotel booking wizard work?
+ </a>
+</p>
+
+</ui:define>
+
+</ui:composition>
1.1 date: 2007/10/01 16:15:51; author: myuan; state: Exp;jboss-seam/examples/icefaces/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">
<s:decorate template="display.xhtml">
<ui:define name="label">Name:</ui:define>
#{hotel.name}
</s:decorate>
<s:decorate template="display.xhtml">
<ui:define name="label">Address:</ui:define>
#{hotel.address}
</s:decorate>
<s:decorate template="display.xhtml">
<ui:define name="label">City:</ui:define>
#{hotel.city}
</s:decorate>
<s:decorate template="display.xhtml">
<ui:define name="label">State:</ui:define>
#{hotel.state}
</s:decorate>
<s:decorate template="display.xhtml">
<ui:define name="label">Zip:</ui:define>
#{hotel.zip}
</s:decorate>
<s:decorate template="display.xhtml">
<ui:define name="label">Country:</ui:define>
#{hotel.country}
</s:decorate>
<s:decorate template="display.xhtml">
<ui:define name="label">Nightly rate:</ui:define>
<h:outputText value="#{hotel.name}">
<f:convertNumber type="currency" currencySymbol="$"/>
</h:outputText>
</s:decorate>
</ui:composition>
1.3 +4 -4 jboss-seam/examples/icefaces/view/index.html
(In the diff below, changes in quantity of whitespace are not shown.)
Index: index.html
===================================================================
RCS file: index.html
diff -N index.html
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ index.html 1 Oct 2007 16:15:51 -0000 1.3
@@ -0,0 +1,5 @@
+<html>
+<head>
+ <meta http-equiv="Refresh" content="0; URL=home.seam">
+</head>
+</html>
\ No newline at end of file
1.10 +62 -54 jboss-seam/examples/icefaces/view/main.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: main.xhtml
===================================================================
RCS file: main.xhtml
diff -N main.xhtml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ main.xhtml 1 Oct 2007 16:15:51 -0000 1.10
@@ -0,0 +1,140 @@
+<!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"
+ xmlns:ice="http://www.icesoft.com/icefaces/component"
+ template="template.xhtml">
+
+<!-- content -->
+<ui:define name="content">
+
+<div class="section">
+
+ <span class="errors">
+ <h:messages globalOnly="true"/>
+ </span>
+
+ <h1>Search Hotels</h1>
+
+ <h:form id="searchCriteria">
+ <fieldset>
+ <ice:selectInputText id="searchString"
+ valueChangeListener="#{hotelSearch.handleSearchStringChange}"
+ value="#{hotelSearch.searchString}"/>
+  
+ <ice:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" />
+  
+ <ice:outputConnectionStatus activeLabel="requesting..." styleClass="connectionStatus"/>
+ <br/>
+
+ <h:outputLabel for="pageSize">Maximum results:</h:outputLabel> 
+ <ice:selectOneMenu id="pageSize"
+ value="#{hotelSearch.pageSize}"
+ valueChangeListener="#{hotelSearch.handlePageSizeChange}"
+ partialSubmit="true">
+ <f:selectItem itemLabel="5" itemValue="5"/>
+ <f:selectItem itemLabel="10" itemValue="10"/>
+ <f:selectItem itemLabel="20" itemValue="20"/>
+ </ice:selectOneMenu>
+ </fieldset>
+ </h:form>
+
+</div>
+<ice:form>
+ <ice:panelGroup id="searchResults">
+ <div class="section">
+ <h:outputText value="No Hotels Found" rendered="#{hotels != null and hotels.rowCount==0}"/>
+ <ice:outputText value="Search Results"/>
+ <ice:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}">
+ <h:column>
+ <f:facet name="header">Name</f:facet>
+ <ice:outputText value="#{hot.name}" onmouseovereffect="#{highlight}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Address</f:facet>
+ <ice:outputText value="#{hot.address}" onmouseovereffect="#{highlight}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">City, State</f:facet>
+ <ice:outputText value="#{hot.city}, #{hot.state}, #{hot.country}" onmouseovereffect="#{highlight}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Zip</f:facet>
+ <ice:outputText value="#{hot.zip}" onmouseovereffect="#{highlight}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Action</f:facet>
+ <ice:commandLink id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
+ </h:column>
+ </ice:dataTable>
+ <s:link value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}"/>
+ </div>
+ </ice:panelGroup>
+</ice:form>
+
+<div class="section">
+ <h1>Current Hotel Bookings</h1>
+
+ <ice:form id="bookings">
+ <h:outputText value="No Bookings Found" rendered="#{bookings.rowCount==0}"/>
+ <ice:dataTable id="bookings" value="#{bookings}" var="book" rendered="#{bookings.rowCount>0}">
+ <h:column>
+ <f:facet name="header">Name</f:facet>
+ <ice:outputText value="#{book.hotel.name}" onmouseovereffect="#{highlight}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Address</f:facet>
+ <ice:outputText value="#{book.hotel.address}" onmouseovereffect="#{highlight}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">City, State</f:facet>
+ <ice:outputText value="#{book.hotel.city}, #{book.hotel.state}" onmouseovereffect="#{highlight}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Check in date</f:facet>
+ <h:outputText value="#{book.checkinDate}" onmouseovereffect="#{highlight}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Check out date</f:facet>
+ <h:outputText value="#{book.checkoutDate}" onmouseovereffect="#{highlight}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Confirmation number</f:facet>
+ <ice:outputText value="#{book.id}" onmouseovereffect="#{highlight}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Action</f:facet>
+ <ice:commandLink id="cancel" value="Cancel" action="#{bookingList.cancel}"/>
+ </h:column>
+ </ice:dataTable>
+ </ice:form>
+</div>
+
+</ui:define>
+
+<!-- sidebar -->
+<ui:define name="sidebar">
+
+<h1>State management in Seam</h1>
+<p>
+ State in Seam is <em>contextual</em>. When you click "Find Hotels", the application
+ retrieves a list of hotels from the database and caches it in the session context. When you
+ navigate to one of the hotel records by clicking the "View Hotel" link, a <em>conversation</em>
+ begins. The conversation is attached to a particular tab, in a particular browser window. You can
+ navigate to multiple hotels using "open in new tab" or "open in new window" in your web browser.
+ Each window will execute in the context of a different conversation. The application keeps state
+ associated with your hotel booking in the conversation context, which ensures that the concurrent
+ conversations do not interfere with each other.
+</p>
+
+<p>
+ <a href="#" onclick="window.open('exp/mainExp.html','exp','width=752,height=500,scrollbars=yes');">
+ How does the search page work?
+ </a>
+</p>
+
+</ui:define>
+
+</ui:composition>
1.5 +106 -81 jboss-seam/examples/icefaces/view/password.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: password.xhtml
===================================================================
RCS file: password.xhtml
diff -N password.xhtml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ password.xhtml 1 Oct 2007 16:15:51 -0000 1.5
@@ -0,0 +1,106 @@
+<!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"
+ xmlns:ice="http://www.icesoft.com/icefaces/component"
+ template="template.xhtml">
+
+<!-- content -->
+
+<ui:define name="content">
+
+
+<div class="section">
+
+ <h1>Change Your Password</h1>
+
+</div>
+
+
+<div class="section">
+
+
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
+
+ <h:form id="setpassword">
+
+
+
+ <fieldset>
+
+
+
+ <s:decorate template="edit.xhtml">
+
+ <ui:define name="label">Password:</ui:define>
+
+ <ice:inputSecret id="password" value="#{user.password}"
+ redisplay="true" required="true"/>
+ </s:decorate>
+
+
+
+ <s:decorate template="edit.xhtml">
+ <ui:define name="label">Verify:</ui:define>
+ <ice:inputSecret id="verify" value="#{changePassword.verify}"
+ redisplay="true" required="true"/>
+ </s:decorate>
+ <div class="buttonBox">
+
+ <h:commandButton id="change" value="Change" action="#{changePassword.changePassword}"/>
+  
+
+ <s:button id="cancel" value="Cancel" view="/main.xhtml"/>
+
+ </div>
+
+
+
+ </fieldset>
+
+
+
+ </h:form>
+
+</div>
+
+
+</ui:define>
+
+
+
+<!-- sidebar -->
+
+<ui:define name="sidebar">
+
+<h1>Simple things should be easy</h1>
+
+<p>
+
+ (And so should some complex things.) You shouldn't have to write four different classes
+
+ just to change a password. Traditional J2EE architectures require that developers spend
+
+ more time writing code to make the frameworks happy, than they ever get to spend writing
+
+ code to make the user happy. Seam lets you reduce the size of your code dramatically.
+
+ And that reduces bugs. And it makes refactoring easier. And it makes delivering new
+
+ functionality quicker. Productivity matters. But with Seam, JSF, EJB 3.0 and jBPM, you
+
+ don't need to sacrifice the ability to handle complex problems just to achieve great
+
+ productivity.
+
+</p>
+
+</ui:define>
+
+
+
+</ui:composition>
1.3 +101 -118 jboss-seam/examples/icefaces/view/register.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: register.xhtml
===================================================================
RCS file: register.xhtml
diff -N register.xhtml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ register.xhtml 1 Oct 2007 16:15:51 -0000 1.3
@@ -0,0 +1,103 @@
+<!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:ice="http://www.icesoft.com/icefaces/component" >
+
+<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">
+
+<ice:panelGroup id="document">
+
+ <div id="header">
+ <ice:panelGroup id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: ICEfaces-seam framework demo"/></ice:panelGroup>
+ </div>
+
+ <ice:panelGroup id="container">
+
+ <div id="sidebar">
+ <h1>Integrated multi-layer validation</h1>
+ <p>
+ Robust applications need data validation in several different places. Seam integrates Hibernate Validator,
+ a set of annotations for expressing data model constraints in your domain model classes. Then, these
+ constraints are applied almost completely transparently at three levels of the application: by Seam when
+ the user first enters data, by EJB before persisting data to the database, and, if you use Hibernate to
+ generate your database schema, by the database constraints themselves. Multi-layer validation hardens
+ your application and protects your data. Even better, it's self-documenting, and easy to change when
+ your business rules change.
+ </p>
+ <p>
+ <a href="#" onclick="window.open('exp/registerExp.html','exp','width=752,height=500,scrollbars=yes');">
+ What happens when I register?
+ </a>
+ </p>
+ </div>
+
+ <ice:panelGroup id="content">
+
+ <div class="section">
+ <h1>Register</h1>
+ </div>
+
+ <div class="section">
+
+ <div class="entry errors">
+ <h:messages globalOnly="true"/>
+ </div>
+
+ <h:form id="registration">
+ <fieldset>
+
+ <s:decorate id="usernameDecorate" template="edit.xhtml">
+ <ui:define name="label">Username:</ui:define>
+ <ice:inputText id="username" value="#{user.username}"
+ required="true" partialSubmit="true"/>
+ </s:decorate>
+
+ <s:decorate id="nameDecorate" template="edit.xhtml">
+ <ui:define name="label">Real Name:</ui:define>
+ <ice:inputText id="name" value="#{user.name}"
+ required="true" partialSubmit="true"/>
+ </s:decorate>
+
+ <s:decorate id="passwordDecorate" template="edit.xhtml">
+ <ui:define name="label">Password:</ui:define>
+ <ice:inputSecret id="password" value="#{user.password}"
+ redisplay="true" partialSubmit="true" required="true"/>
+ </s:decorate>
+
+ <s:decorate id="verifyDecorate" template="edit.xhtml">
+ <ui:define name="label">Verify Password:</ui:define>
+ <ice:inputSecret id="verify" value="#{register.verify}"
+ redisplay="true" partialSubmit="true" required="true"/>
+ </s:decorate>
+
+ <div class="buttonBox">
+ <ice:commandButton id="register" value="Register" action="#{register.register}"/>
+  
+ <s:button id="cancel" value="Cancel" view="/home.xhtml"/>
+ </div>
+
+ </fieldset>
+ </h:form>
+
+ </div>
+
+ </ice:panelGroup>
+
+ </ice:panelGroup>
+
+ <div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
+
+</ice:panelGroup>
+
+</body>
+
+</html>
1.4 +40 -36 jboss-seam/examples/icefaces/view/template.xhtml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: template.xhtml
===================================================================
RCS file: template.xhtml
diff -N template.xhtml
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ template.xhtml 1 Oct 2007 16:15:51 -0000 1.4
@@ -0,0 +1,40 @@
+<!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"
+ xmlns:ice="http://www.icesoft.com/icefaces/component">
+<head>
+ <ice:outputDeclaration doctypeRoot="HTML"
+ doctypePublic="-//W3C//DTD XHTML 1.0 Transitional//EN"
+ doctypeSystem="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+ <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, ICEfaces and Facelets</div>
+</div>
+</body>
+</html>
More information about the jboss-cvs-commits
mailing list