This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A Nagging Doubt About My Search Functionality

 
Kevin Florish
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Alecsandru Cocarla
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Alain Dickson
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
He probably has two combo boxes, one for name and one for location.
 
Alain Dickson
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alain.

Was hoping you had another combo box, just mentioned it to make sure
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic