Small markup fixes.

This commit is contained in:
Daniel Fernández
2012-12-27 02:25:42 +01:00
committed by Rossen Stoyanchev
parent 880586585b
commit 7ff65c47e3
8 changed files with 55 additions and 17 deletions

View File

@@ -38,10 +38,12 @@
<div class="span-7 last">
<p><input type="text" th:field="*{checkinDate}" /></p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "checkinDate",
widgetType : "dijit.form.DateTextBox",
widgetAttrs : { datePattern : "MM-dd-yyyy", required : true }}));
widgetAttrs : { datePattern : "MM-dd-yyyy", required : true }}));
// ]]>
</script>
</div>
@@ -53,10 +55,12 @@
<div class="span-7 last">
<p><input type="text" th:field="*{checkoutDate}" /></p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "checkoutDate",
widgetType : "dijit.form.DateTextBox",
widgetAttrs : { datePattern : "MM-dd-yyyy", required : true }}));
widgetAttrs : { datePattern : "MM-dd-yyyy", required : true }}));
// ]]>
</script>
</div>
</div>
@@ -84,6 +88,7 @@
<input type="radio" id="non-smoking" th:field="*{smoking}" value="false" /><label for="non-smoking">Non Smoking</label>
</p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : 'smoking',
widgetType : "dijit.form.RadioButton",
@@ -96,6 +101,7 @@
widgetModule : "dijit.form.CheckBox",
widgetAttrs : { value : "false" }
}));
// ]]>
</script>
</div>
</div>
@@ -112,6 +118,7 @@
<input type="checkbox" th:field="*{amenities}" value="MINIBAR" /><label th:for="${#ids.prev('amenities')}">Minibar</label>
</p>
<script type="text/javascript">
// <![CDATA[
dojo.query("#amenities input[type='checkbox']").forEach(function(element){
Spring.addDecoration(new Spring.ElementDecoration({
elementId: element.id,
@@ -119,6 +126,7 @@
widgetAttrs : { checked : element.checked }
}));
});
// ]]>
</script>
</div>
</div>
@@ -129,11 +137,13 @@
<div class="span-7 last">
<p><input type="text" th:field="*{creditCard}" /></p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "creditCard",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { required : true, invalidMessage : "A 16-digit credit card number is required.",
regExp : "[0-9]{16}" }}));
// ]]>
</script>
</div>
</div>
@@ -144,10 +154,12 @@
<div class="span-7 last">
<p><input type="text" th:field="*{creditCardName}" maxlength="40" /></p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "creditCardName",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { required : true }}));
// ]]>
</script>
</div>
</div>
@@ -183,12 +195,14 @@
</div>
<div>
<p>
<button type="submit" id="proceed" name="_eventId_proceed">Proceed</button>
<button type="submit" name="_eventId_cancel" >Cancel</button>
<button type="submit" id="proceed" name="_eventId_proceed">Proceed</button>
<button type="submit" name="_eventId_cancel" >Cancel</button>
</p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'proceed', event:'onclick'}));
Spring.addDecoration(new Spring.AjaxEventDecoration({elementId:'proceed',event:'onclick',formId:'booking'}));
// ]]>
</script>
</div>
</fieldset>

View File

@@ -61,7 +61,9 @@
<button type="submit" name="_eventId_cancel">Cancel</button>
</p>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.AjaxEventDecoration({elementId:'revise',event:'onclick',formId:'confirm'}));
// ]]>
</script>
</div>

View File

@@ -1,19 +1,25 @@
<h1>Hotel Results</h1>
<p>
<a id="changeSearchLink" href="#"
th:href="@{hotels/search(searchString=${searchCriteria.searchString},pageSize=${searchCriteria.pageSize})}">Change Search</a>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "changeSearchLink",
event: "onclick",
popup: true,
params: {fragments: "searchForm"}
}));
// ]]>
</script>
</p>
<div id="hotelResults">
<div th:if="${hotelList}">
<table class="summary">
<thead>
<tr>
@@ -37,17 +43,20 @@
</tr>
</tbody>
</table>
<div class="buttonGroup">
<div class="span-3">
<div th:if="${searchCriteria.page > 0}">
<a id="prevResultsLink" href="#"
th:href="@{hotels(searchString=${searchCriteria.searchString},pageSize=${searchCriteria.pageSize},page=${searchCriteria.page - 1})}">Previous Results</a>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "prevResultsLink",
event: "onclick",
params: {fragments: "body"}
}));
// ]]>
</script>
</div>
</div>
@@ -56,15 +65,18 @@
<a id="moreResultsLink" href="#"
th:href="@{hotels(searchString=${searchCriteria.searchString},pageSize=${searchCriteria.pageSize},page=${searchCriteria.page + 1})}">More Results</a>
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "moreResultsLink",
event: "onclick",
params: {fragments: "body"}
}));
// ]]>
</script>
</div>
</div>
</div>
</div>
</div>

View File

@@ -1,4 +1,4 @@
<div tiles:include="searchForm"></div>
<div tiles:include="searchForm">Search form here...</div>
<div tiles:include="bookingsTable"></div>
<div tiles:include="bookingsTable">Bookings table here...</div>

View File

@@ -11,19 +11,21 @@
<label for="searchString">Search String:</label>
<input type="text" id="searchString" th:field="*{searchString}" />
<script type="text/javascript">
// <![CDATA[
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "searchString",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : { promptMessage : "Search hotels by name, address, city, or zip." }}));
// ]]>
</script>
</div>
<div class="span-6">
<div>
<label for="pageSize">Maximum results:</label>
<select id="pageSize" th:field="*{pageSize}">
<option label="5" value="5"/>
<option label="10" value="10"/>
<option label="20" value="20"/>
<option label="5" value="5" />
<option label="10" value="10" />
<option label="20" value="20" />
</select>
</div>
</div>

View File

@@ -1,14 +1,17 @@
<h1 th:text="${hotel.name}">The Herb Plaza</h1>
<address>
<span th:text="${hotel.address}">Thyme Square, 13</span>
<address th:object="${hotel}">
<span th:text="*{address}">Thyme Square, 13</span>
<br />
<span th:text="${hotel.city}">Icetown</span>,
<span th:text="${hotel.state}">North Pole</span>,
<span th:text="${hotel.zip}">0W</span>
<span th:text="*{city}">Icetown</span>,
<span th:text="*{state}">North Pole</span>,
<span th:text="*{zip}">0W</span>
<br />
<span th:text="${hotel.country}">Earth</span>
<span th:text="*{country}">Earth</span>
</address>
<form action="booking?mode=embedded" method="get">
<form action="#" th:action="@{/hotels/booking(mode='embedded')}" method="get">
<p>
Nightly Rate: <span th:text="${hotel.price}">4,300</span>
</p>

View File

@@ -3,7 +3,7 @@
<p>
This sample demonstrates how to use Spring MVC and Spring Web Flow together with JavaServerPages (JSP) and Tiles.
</p>
<hr/>
<hr />
<p>
The key features illustrated in this sample include:
</p>

View File

@@ -23,6 +23,7 @@
<body class="tundra">
<div id="page" class="container">
<div id="header">
<div id="topbar">
<p sec:authorize="hasRole('ROLE_USER')" th:if="${#authentication}">
@@ -41,6 +42,7 @@
</p>
</div>
</div>
<div id="content">
<div id="local" class="span-6">
<p>
@@ -58,12 +60,15 @@
Body here...
</div>
</div>
<hr />
<div id="footer">
<a href="http://www.springframework.org">
<img src="../../images/powered-by-spring.png" th:src="@{/resources/images/powered-by-spring.png}" alt="Powered by Spring" />
</a>
</div>
</div>
</body>
</html>