File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes A Nagging Doubt About My Search Functionality Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "A Nagging Doubt About My Search Functionality" Watch "A Nagging Doubt About My Search Functionality" New topic
Author

A Nagging Doubt About My Search Functionality

Kevin Florish
Ranch Hand

Joined: Jan 06, 2009
Posts: 176
Hi Fellow ranchers

Almost ready to submit my assignment but have a worry about my search functionality. Here is an excerpt from my choices.txt document:





Is this acceptable as I am worried about it now.

Thanks Kevin.

Java5 Tutorials | Java6 Tutorials | HTML/CSS Tutorials | JavaScript and jQuery Tutorials
Alecsandru Cocarla
Ranch Hand

Joined: Feb 29, 2008
Posts: 158
I think it's acceptable, and I saw some other people around here adopting the same approach (comboboxes).
You can try searching the forum for discussions about this (try also the results forum).


SCJP 1.4 100%
SCJD 99.5%
Alain Dickson
Ranch Hand

Joined: Dec 08, 2008
Posts: 53

Kevin - I have adopted a hybrid approach, My Combo Box is editable with two options "any" and "Contractor Name" taking example of Contractor Name(B&S assignment).

if the user select the option "contractor Name" I set it to blank space and let user type what ever he/she wants to search. Hence i don't wory about updating the list when ever database changes and also even if the database grows huge in future, I don't have to wory about it.
Kevin Florish
Ranch Hand

Joined: Jan 06, 2009
Posts: 176
Hi Alain

For B&S aren't you supposed to be able to search on name and / or location.

From the User Interface section of B&S 2.2.1 (yours may be different).


It must allow the user to search the data for all records, or for records where the name and/or location fields exactly
match values specified by the user.


So I think with your solution you should probably add location to your combo box.

Also what about the scenario where a user wants to search with name and location (composite key) in my case. I return the unique record for this name and location.

Regards Kevin.
Alecsandru Cocarla
Ranch Hand

Joined: Feb 29, 2008
Posts: 158
He probably has two combo boxes, one for name and one for location.
Alain Dickson
Ranch Hand

Joined: Dec 08, 2008
Posts: 53
Alecsandru is right, I mentioned one to keep it short.

Here is some Detail:
for Name:Two options are "any" and "Contractor Name"

for Location: Two Options are "any" and "Contractor Location"

When user selects second option for Name/Location it is set to blank indicating to type in Name/Location.

User can type in for both Name and Location:- which gets records where both name and location matches
User can type in name and set location to any and vice versa.
User can set both to any: in which case all records will be loaded into the Table.
Kevin Florish
Ranch Hand

Joined: Jan 06, 2009
Posts: 176
Hi Alain.

Was hoping you had another combo box, just mentioned it to make sure
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: A Nagging Doubt About My Search Functionality