http://jira.springframework.org/browse/SWF-834 Sample apps should demonstrate collection and enum binding
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package org.springframework.webflow.samples.booking;
|
||||
|
||||
public enum Amenity {
|
||||
OCEAN_VIEW, LATE_CHECKOUT, MINIBAR;
|
||||
}
|
||||
@@ -49,6 +49,8 @@ public class Booking implements Serializable {
|
||||
|
||||
private int beds;
|
||||
|
||||
private Amenity amenities;
|
||||
|
||||
public Booking() {
|
||||
}
|
||||
|
||||
@@ -178,6 +180,15 @@ public class Booking implements Serializable {
|
||||
this.creditCardExpiryYear = creditCardExpiryYear;
|
||||
}
|
||||
|
||||
@Transient
|
||||
public Amenity getAmenities() {
|
||||
return amenities;
|
||||
}
|
||||
|
||||
public void setAmenities(Amenity amenities) {
|
||||
this.amenities = amenities;
|
||||
}
|
||||
|
||||
public void validateEnterBookingDetails(MessageContext context) {
|
||||
if (checkinDate.before(today())) {
|
||||
context.addMessage(new MessageBuilder().error().source("checkinDate").code(
|
||||
|
||||
@@ -89,6 +89,18 @@
|
||||
</h:selectOneRadio>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">
|
||||
<h:outputLabel for="amenities">Amenities:</h:outputLabel>
|
||||
</div>
|
||||
<div class="input">
|
||||
<h:selectOneRadio id="amenities" value="#{booking.amenities}" layout="pageDirection">
|
||||
<f:selectItem itemValue="OCEAN_VIEW" itemLabel="Ocean View" />
|
||||
<f:selectItem itemValue="LATE_CHECKOUT" itemLabel="Late Checkout" />
|
||||
<f:selectItem itemValue="MINIBAR" itemLabel="Minibar" />
|
||||
</h:selectOneRadio>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="label">
|
||||
<h:outputLabel for="creditCard">Credit Card #:</h:outputLabel>
|
||||
|
||||
Reference in New Issue
Block a user