Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: Contractors: One or two search fields?

 
Werner Joerling
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
the instructions require:

It [the user interface] 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.

the instructions deliver:

// Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. A null value in criteria[n] matches any field
// value. A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".)
public int [] find(String [] criteria)

What do you think is better?
1. To have two search fields, one for the name and one for the city.
2. To have one search field for both the name and the city.
The first option is that I prefer, because it fits excellent to the method find().
The second option I feel is that most people want to see. But it seems cumbersomely to implement, because one has to call the method find() twice and to unite the results without duplicates.
Any suggestions?
Werner
[ September 02, 2003: Message edited by: Werner Joerling ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am working on the same assignment as yours, I think at least there should be two search field, you can input the criteria word or leave it there with "all" as default. When you input a name, and don't input location, you search all location by default, and vice versa. Thus you can search for records where the name and/or location fields exactly match values specified by the user.
Hope I can help you.
Regards,
Damu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic