item.add(new Label("hotelName", hotel.getName()));
item.add(new Label("hotelAddress", hotel.getAddress()));
item.add(new Label("hotelCityStateCountry", hotel.getCity() + ", " + hotel.getState() + ", " + hotel.getCountry()));
item.add(new Label("hotelZip", hotel.getZip()));
//item.add(new BookmarkablePageLink("viewHotel", org.jboss.seam.example.wicket.Hotel.class).setParameter("hotelId", hotel.getId()));
item.add(new Link("viewHotel")
{
@Begin
@Override
public void onClick()
{
hotelBooking.selectHotel(hotel);
setResponsePage(new org.jboss.seam.example.wicket.Hotel(new PageParameters()));
}
});
}
};
// Set the maximum items per page
hotelDataView.setItemsPerPage(hotelSearchForm.getPageSize());
hotelDataView.setOutputMarkupId(true);
hotels = new WebMarkupContainer("hotels");
hotels.add(hotelDataView).setOutputMarkupId(true);
// Add a pager
hotels.add(new AjaxPagingNavigator("hotelPager", hotelDataView)
{
@Override
public boolean isVisible()
{
return hotelDataView.isVisible();
}
});
body.add(hotels);
/*
* Existing hotel booking
*/
bookedHotelDataView = new DataView("bookedHotel", new SimpleDataProvider()
{
public Iterator iterator(int from, int count)
{
return bookings.subList(from, from + count).iterator();
}
public int size()
{
return bookings.size();
}
})
{
@Override
protected void populateItem(Item item)
{
final Booking booking = (Booking) item.getModelObject();
item.add(new Label("hotelName", booking.getHotel().getName()));
item.add(new Label("hotelAddress", booking.getHotel().getAddress()));
item.add(new Label("hotelCityStateCountry", booking.getHotel().getCity() + ", " + booking.getHotel().getState() + ", " + booking.getHotel().getState()));
item.add(new Label("hotelCheckInDate", booking.getCheckinDate().toString()));
item.add(new Label("hotelCheckOutDate", booking.getCheckoutDate().toString()));
item.add(new Label("hotelConfirmationNumber", booking.getId().toString()));
item.add(new Link("cancel")
{
@Override
public void onClick()
{