• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Viewing rooms outside of 48 hour rule (Urlybird)

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm trying to figure out how I should list the rooms based on the available date.

Should I just list rooms available within the next 48 hours? If I go with this option I'm afraid that the examiner will not see any bookings available when the client is launched with the default db file.

OR....

Should I list all non-booked rooms and make the rooms outside of the 48 hour period non-selectable? Could anyone give me a hint how o make certain rows in a jtable selectable/non-selectable?

Thanks,
Jon
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I listed all rooms in decending order of available date :
  • more than 48 hours in the future - grayed out (not yet bookable)
  • within 48 hours - white (bookable)
  • older than 48 hours - grayed out (not bookable anymore)
  • already booked - grayed out (not bookable anymore, in correct order with respect to available date of the above 3 items)


  • In my implementation the user could always select a room, meaning he could click on the row in the JTable.
    However, the "Book" button was enable/disabled depending on the status of the selected row.

    Hope this helps.
     
    Ranch Hand
    Posts: 38
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi,

    It's a very good idea to have additional "Status" column. Ronald wrote, its possible to distinguish between all states of a room:

    - AVAILABLE IN FUTURE
    - AVAILABLE NOW
    - ALREADY BOOKED
    - NOT AVAILABLE

    But you have to be very careful, while disabling "BOOK" action for certain room. State of room can change dynamically, see following scenario:

    - generate list of rooms at 11:59PM
    - wait 2 minutes and try booking a room with "AVAILABLE IN FUTURE".

    To solve this problem, I never disable "Book" button. I prefer to check the availability of a room just before booking operation.

    Additionally, I consider to provide some kind of "Refresh" action. Two solutions are in my mind:
    - recalculate availability of rooms without reloading data from database,
    - or reload data using the same find criteria.

    This option may be useful to check whether rooms retrieved some time ago are up to date.

    regards,
    Robert
     
    Ronald Wouters
    Ranch Hand
    Posts: 198
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Robert,

    I mentioned your scenario in my user guide and advised the users to logoff and logon again when they came back after lunch. I also mentioned this in my choices.txt as a possible "issue".
    I didn't go as far as to implement some kind of "refresh" button/functionality. I figured that was just a bit out of scope ... or maybe I was just a bit anxious to get this thing uploaded and done with


    Regards
     
    Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic