This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I call a funtion on initialization to get all the contractor's name. I populate the name combo box used in my search panel with this. I do the same for location. I only allow the name and location to be searched. Since I only allow the client to book and search, I know the list won't change. Can anyone give me their thoughts on this approach?
risky. Right now there's only one type of client on that database engine. But that's hardly guaranteed to last, in the future another client might be created (or this one expanded) that can enter new records for new contractors.
It's your decision whether you want to be prepared for that or not of course.
Myself, I've not used dropdowns at all. The user can type in search terms which are then sent to the server which uses them to filter the data.
I too prepopulate the Combo Boxes in the initial stages but then i refresh this "Meta data" every time i get some results from the server and that will take care of refreshing the data at every search.
It is risky to only populate at the initial stage what if the a certain hotel gets filled within the time you have launched the client. It is very likely that the CSRs do not launch the server every time they want to book. They will only launch it once in the morning.
Try adding a refresh method that will refresh the data for these combo box.