String id = new FacesRequest("/main.xhtml") {
@Override
protected void invokeApplication() throws Exception {
HotelBookingAction hotelBooking = (HotelBookingAction) getInstance("hotelBooking");
DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
hotels.setRowIndex(0);
hotelBooking.selectHotel((Hotel) hotels.getRowData());
}
}.run();
id = new FacesRequest("/hotel.xhtml", id) {