3 Replies Latest reply on Feb 11, 2007 3:56 PM by saeediqbal1

    Booking example allows check in date > check out

    saeediqbal1

      Is this bug intentional in the booking example? Currently we can have check out date to be earlier than check in date even though the logic in the HotelBookingAction.java checks for it and documentation has a slightly different code. Or is something else broken?

      Please advise.

        • 1. Re: Booking example allows check in date > check out
          saeediqbal1

          This is interesting. Here is the confirm hotel booking page content. negative pricing. hmmm

          Name:
          W Hotel
          Address:
          Union Square, Manhattan
          City, State:
          NY, NY
          Zip:
          10011
          Country:
          USA
          Total payment:
          -$4,050.00
          Check In Date:
          Feb 11, 2007
          Check Out Date:
          Feb 2, 2007
          Credit Card #:
          3332333233323332

          • 2. Re: Booking example allows check in date > check out
            gavin.king

            Oooops, the following diff corrects the problem:


            Index: resources/WEB-INF/pages.xml
            ===================================================================
            RCS file: /cvsroot/jboss/jboss-seam/examples/booking/resources/WEB-INF/pages.xml,v
            retrieving revision 1.13
            diff -r1.13 pages.xml
            72,73c72,75
            < <navigation from-action="#{hotelBooking.setBookingDetails}">
            < <redirect view-id="/confirm.xhtml"/>
            ---
            > <navigation from-action="#{hotelBooking.setBookingDetails}">
            > <rule if="#{hotelBooking.bookingValid}">
            > <redirect view-id="/confirm.xhtml"/>
            > </rule>
            Index: src/org/jboss/seam/example/booking/HotelBookingAction.java
            ===================================================================
            RCS file: /cvsroot/jboss/jboss-seam/examples/booking/src/org/jboss/seam/example/booking/HotelBookingAction.java,v
            retrieving revision 1.45
            diff -r1.45 HotelBookingAction.java
            75a76
            > bookingValid=false;
            79a81
            > bookingValid=false;
            


            • 3. Re: Booking example allows check in date > check out
              saeediqbal1

              Hi Gavin,

              This change works. Thank you.

              I was hoping to find out for the sake of consistency that can we show that alert message as soon as the date field was filled onblur ? because the credit card validation is done that way but date validation is done only when we click proceed button.