polish
This commit is contained in:
@@ -190,10 +190,6 @@ public class Booking implements Serializable {
|
||||
return valid;
|
||||
}
|
||||
|
||||
public static Booking newInstance(Hotel hotel, User user) {
|
||||
return new Booking(hotel, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Booking(" + user + "," + hotel + ")";
|
||||
|
||||
@@ -99,6 +99,10 @@ public class Hotel implements Serializable {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Booking createBooking(User user) {
|
||||
return new Booking(this, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Hotel(" + name + "," + address + "," + city + "," + zip + ")";
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<start-actions>
|
||||
<evaluate-action expression="#{bookingService.findHotelById(id)}" result="#{flowScope.hotel}" />
|
||||
<evaluate-action expression="Booking.newInstance(hotel, user)" result="#{flowScope.booking}"/>
|
||||
<evaluate-action expression="hotel.createBooking(currentUser)" result="#{flowScope.booking}"/>
|
||||
<evaluate-action expression="entityManager.persist(booking)"/>
|
||||
</start-actions>
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</div>
|
||||
<div class="input">
|
||||
<h:selectOneMenu id="beds" value="#{booking.beds}">
|
||||
<f:selectItems value="#{bookingOptions.bedOptions}"/>
|
||||
<f:selectItems value="#{referenceData.bedOptions}"/>
|
||||
</h:selectOneMenu>
|
||||
</div>
|
||||
</div>
|
||||
@@ -81,7 +81,7 @@
|
||||
</div>
|
||||
<div id="radio" class="input">
|
||||
<h:selectOneRadio id="smoking" value="#{booking.smoking}" layout="pageDirection">
|
||||
<f:selectItems value="#{bookingOptions.smokingOptions}"/>
|
||||
<f:selectItems value="#{referenceData.smokingOptions}"/>
|
||||
</h:selectOneRadio>
|
||||
</div>
|
||||
</div>
|
||||
@@ -111,10 +111,10 @@
|
||||
</div>
|
||||
<div class="input">
|
||||
<h:selectOneMenu id="creditCardExpiryMonth" value="#{booking.creditCardExpiryMonth}">
|
||||
<f:selectItems value="#{bookingOptions.creditCardExpMonths}" />
|
||||
<f:selectItems value="#{referenceData.creditCardExpMonths}" />
|
||||
</h:selectOneMenu>
|
||||
<h:selectOneMenu id="creditCardExpiryYear" value="#{booking.creditCardExpiryYear}">
|
||||
<f:selectItems value="#{bookingOptions.creditCardExpYears}"/>
|
||||
<f:selectItems value="#{referenceData.creditCardExpYears}"/>
|
||||
</h:selectOneMenu>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,11 +24,9 @@
|
||||
</div>
|
||||
<div class="searchSize">
|
||||
<h:outputLabel for="pageSize">Maximum results:</h:outputLabel>
|
||||
<h:selectOneMenu value="#{flowScope.searchCriteria.pageSize}" id="pageSize">
|
||||
<f:selectItem itemLabel="5" itemValue="5"/>
|
||||
<f:selectItem itemLabel="10" itemValue="10"/>
|
||||
<f:selectItem itemLabel="20" itemValue="20"/>
|
||||
</h:selectOneMenu>
|
||||
<h:selectOneMenu id="pageSize" value="#{flowScope.searchCriteria.pageSize}">
|
||||
<f:selectItems value="#{referenceData.pageSizeOptions}"/>
|
||||
</h:selectOneMenu>
|
||||
</div>
|
||||
<div class="searchButton">
|
||||
<sf:commandButton id="findHotels" value="Find Hotels" processIds="hotelSearchFragment" action="findHotels"/>
|
||||
|
||||
Reference in New Issue
Block a user