This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes How to get search criteria:Field vs ComboBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "How to get search criteria:Field vs ComboBox" Watch "How to get search criteria:Field vs ComboBox" New topic
Author

How to get search criteria:Field vs ComboBox

Leo Tien
Ranch Hand

Joined: Sep 10, 2002
Posts: 156
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?
Miguel Roque
Ranch Hand

Joined: Oct 24, 2002
Posts: 126
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

Joined: Sep 10, 2002
Posts: 156
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

Joined: Sep 10, 2002
Posts: 156
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.
mao lao
Greenhorn

Joined: Nov 26, 2002
Posts: 26
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get search criteria:Field vs ComboBox
 
Similar Threads
Search functionality ?!
[NX] Question about the findByCriteria.
criteria and criteriaFind
Confuse the findByCriteria()
About criteria??