• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Search

 
Wickes Potgieter
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have read a couple of threads and am a bit confused on the Search subject. Why is some people using the JCombobox for the search criteria fields. Can't I just use a normal textfield? What is the reason?
 
Steven Sloggett
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Wickes Potgieter:
I have read a couple of threads and am a bit confused on the Search subject. Why is some people using the JCombobox for the search criteria fields. Can't I just use a normal textfield? What is the reason?

Yes, you can use a text field. Most people use a combo box so that the user does not have to remember the airport codes or carrier names - they can select them from a list instead.
It depends on the knowledge of your target audience. Provided you can justify either choice, it doesn't matter which you use.
 
Wickes Potgieter
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steven!
 
Jim Bedenbaugh
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Wickes Potgieter:
I have read a couple of threads and am a bit confused on the Search subject. Why is some people using the JCombobox for the search criteria fields. Can't I just use a normal textfield? What is the reason?

Wickes,
You should remember that in real life, the origin and destination codes are supplied from an industry organization for a fee. The codes are called IATA codes. In real airline reservation systems, like the system from a large airline in Dallas, Texas, USA (hint, hint), these are all kept in a table. In this particular system, you can type in text in what is called "native", but think about your poor user - there are over 9,000 of these codes worldwide - no one can remember all these! Having a JComboBox sure makes it easier for them. And, since the only reason we write systems is to make their lives easier (and since they pay my salary), I'm gonna do everything I can to make their life easier.
In my implementation, I read db.db and get all the different IATA codes from the file and populate the JComboBoxes - in other words, in my implementation, you can only go places that FBN actually books flights for.
Even though I actually have the entire IATA code file, I'm not going to include it because it's overkill and would take too long to load up in the application, but if if I were deploying this for use across the web, like Travelocity, I would include it (on the server side) for validation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic