Author: dan.j.allen
Date: 2009-05-04 00:49:56 -0400 (Mon, 04 May 2009)
New Revision: 10764
Removed:
examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/user.xhtml
Modified:
examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/hotel.xhtml
examples/trunk/booking/war/src/main/webapp/confirm.xhtml
examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml
Log:
converter can be passed in as child rather than overriding entire output component
Modified: examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/hotel.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/hotel.xhtml 2009-05-04
04:39:28 UTC (rev 10763)
+++ examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/hotel.xhtml 2009-05-04
04:49:56 UTC (rev 10764)
@@ -15,10 +15,8 @@
<p:display label="Class" override="true">
<h:graphicImage value="/img/#{hotel.stars}-star.gif"
style="padding-top: 4px;"/>
</p:display>
- <p:display label="Nightly rate" override="true">
- <h:outputText value="#{hotel.price}">
- <f:convertNumber type="currency" currencySymbol="$"/>
- </h:outputText>
+ <p:display label="Nightly rate" value="#{hotel.price}">
+ <f:convertNumber for="output" type="currency"
currencySymbol="$"/>
</p:display>
</ui:composition>
Deleted: examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/user.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/user.xhtml 2009-05-04
04:39:28 UTC (rev 10763)
+++ examples/trunk/booking/war/src/main/webapp/WEB-INF/fragments/user.xhtml 2009-05-04
04:49:56 UTC (rev 10764)
@@ -1,21 +0,0 @@
-<!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:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:p="http://http://java.sun.com/jsf/composite/property">
-
- <p:display label="Name" value="#{hotel.name}"/>
- <p:display label="Address" value="#{hotel.address}"/>
- <p:display label="City" value="#{hotel.city}"/>
- <p:display label="State" value="#{hotel.state}"/>
- <p:display label="Zip" value="#{hotel.zip}"/>
- <p:display label="Country" value="#{hotel.country}"/>
- <p:display label="Nightly rate" override="true">
- <h:outputText value="#{hotel.price}">
- <f:convertNumber type="currency" currencySymbol="$"/>
- </h:outputText>
- </p:display>
-
-</ui:composition>
Modified: examples/trunk/booking/war/src/main/webapp/confirm.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/confirm.xhtml 2009-05-04 04:39:28 UTC (rev
10763)
+++ examples/trunk/booking/war/src/main/webapp/confirm.xhtml 2009-05-04 04:49:56 UTC (rev
10764)
@@ -17,22 +17,16 @@
<ui:include src="/WEB-INF/fragments/hotel.xhtml"/>
- <p:display label="Total payment" override="true">
- <h:outputText value="#{booking.total}">
- <f:convertNumber type="currency"
currencySymbol="$"/>
- </h:outputText>
+ <p:display label="Total payment"
value="#{booking.total}">
+ <f:convertNumber for="output" type="currency"
currencySymbol="$"/>
</p:display>
- <p:display label="Check-in date" override="true">
- <h:outputText value="#{booking.checkinDate}">
- <f:convertDateTime type="date"
pattern="MM/dd/yyyy"/>
- </h:outputText>
+ <p:display label="Check-in date"
value="#{booking.checkinDate}">
+ <f:convertDateTime for="output" type="date"
pattern="MM/dd/yyyy"/>
</p:display>
- <p:display label="Check-out date" override="true">
- <h:outputText value="#{booking.checkoutDate}">
- <f:convertDateTime type="date"
pattern="MM/dd/yyyy"/>
- </h:outputText>
+ <p:display label="Check-out date"
value="#{booking.checkoutDate}">
+ <f:convertDateTime for="output" type="date"
pattern="MM/dd/yyyy"/>
</p:display>
<p:display label="Credit card #"
value="#{booking.creditCard}"/>
Modified: examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml
===================================================================
--- examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml 2009-05-04
04:39:28 UTC (rev 10763)
+++ examples/trunk/booking/war/src/main/webapp/resources/property/display.xhtml 2009-05-04
04:49:56 UTC (rev 10764)
@@ -13,7 +13,6 @@
<comp:attribute name="override" required="false"
default="false"/>
</comp:interface>
- <!-- the override is a workaround because assigning an id to the output dynamically
is not working -->
<!-- TODO allow for a template to be specified, falling back to a default -->
<comp:implementation>
<div class="entry">
@@ -21,7 +20,7 @@
<span class="output">
<c:choose>
<c:when
test="#{cc.attrs.override}"><comp:insertChildren/></c:when>
- <c:otherwise>#{cc.attrs.value}</c:otherwise>
+ <c:otherwise><h:outputText id="output"
value="#{cc.attrs.value}"><comp:insertChildren/></h:outputText></c:otherwise>
</c:choose>
</span>
</div>