• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to get search criteria:Field vs ComboBox

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On the GUI design, whitch the best way to get the search criteria? I want to provide one field allow the user enter the criteria text. But someone suggest use ComboBox or other component prevent the use enter any text. I think, if accept the last one, how can I define the search criteria? Whether read the data from proper field of the db.db file, then pass it to ComboBox, if so, must need refresh the client GUI when the server side is modified, don't this make the system more complex?
 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Leo.
Use combo's instead of text fields. Combos are more user friendly and doesn't allow errors of input. Regarding how to fill the combo's, you fill them when the application starts only. You don't need to complicate your design and trigger a new read when the database changes. If you read the requirements of FBN assignment, Sun says that you don't need to provide live update when someone else reserves a seat so this can also be used here.
Miguel
 
Leo Tien
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Miguel, thanks for your reply.
Now I have another question, how can I define the search criteria of the Combo? If there are ten thousand records in the db.db file, the criteria will be terrible, How you do this?
Thanks.
 
Leo Tien
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whether my statement is blur. My question is if i use ComboBox to support search criteria mechanism, how to define the item in ComboBox, in other word to define the criteria text?
For example, if there is a record and it's name field's value is "foo" in the db.db file, then I will support the search criteria as "fo" or "f" or "foo", but there is another record named "far", how I can do? Support "fa" , "f", "far"? If this, if there are ten thousand records in the db.db, should i define thirty thousand search criteria text? If the name field name is longer, it's terrible!
Am I right??? How do you make this??
Thanks.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SUN says

Note that only exact matches need to be handled


so if db.db has "foo", only "foo" needed
also I think u need use distinct, so 30 thousands record do not mean 30 thousands items in your combobox
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic