This week's book giveaway is in the Cloud forum.
We're giving away four copies of The Business Blockchain and have William Mougayar on-line!
See this thread for details.
Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Viewing rooms outside of 48 hour rule (Urlybird)

 
Jonathan Culloty
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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
 
Ronald Wouters
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • 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.
     
    Robert Bar
    Ranch Hand
    Posts: 38
    • Mark post as helpful
    • send pies
    • 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: 190
    • Mark post as helpful
    • send pies
    • 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
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic