Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

NX:Contractor Search Requirement

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some one help me understand this GUI requirement. I have several interpretations, but feed back would be greatly appreciated:


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.

 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IMO this means:
1) you must be able to start a search that will return all records in the database. This is the same as having no search criteria.
2) you must be able to search both the name and/or location and have the and return all records where they match your criteria.
I created a getSearchCriteria dialog and allowed users to enter the criteria for all of the fields in JTextFields. You could use combo boxes here but that only works for databases of limited size.
The search criteria themselves are stored in an String[] and are compared to the database fields using :
for(int j = 0; j < arrayLength; j++) {
if ((criteria[j] != null)
&& (!(fields[j].toUpperCase()).startsWith(
criteria[j].toUpperCase()))) {
selectRec = false;
}
} //for
ms
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the exact same requirements. I am thinking
of providing three fields they can use
to search (an empty field means search all):
1. A textbox where they can search on any given
string. And when I search I am going to compare
all fields of each record.
2. A combo box or another text field where they
must enter the contractors name. The search looks
only for exact matches and of course only compares
the contractor's name.
3. A combo box or another text field where they
must enter the contractor's location. The search looks only for exact matches and of course only compares the contractor's location.
For number 2 and 3 I can't decide whether to offer a combo box or simply a text field.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't use TextBoxes, I would use JComboBoxes.
Mike your #1 and #2 look accurate.
Mark
 
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
I’m now working on the Contractors assignment v2.3.3. I’ve a similar question posted by Chris.
According to Mike’s reply:
---------
IMO this means:
1) you must be able to start a search that will return all records in the database. This is the same as having no search criteria.
2) you must be able to search both the name and/or location and have the and return all records where they match your criteria.
----------
For point # 1, does that mean…
Say both name and location fields are implemented using JComboxBox. Without any selection from the drop-down list, the fields remain blank for both name and location. When the user presses the Search button, all the records in the db shall be displayed on the screen.
For point # 2, does that mean…
Initially, I thought the user can enter search criteria for all the fields (especially the specialities field) mentioned in the db file, i.e. name, location, specialities, size, rate, owner. But now, it seems like the user can only enter two search criteria, i.e. name and location.
Am I right with the two assumptions made above?
Also, do you think I should display all the records on the screen when the client application first starts up?
Thanks!
Joyce
 
author and jackaroo
Posts: 12199
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joyce,
Point 1: yes, that is one way you could implement it.
Point 2: the instructions can be a bit confusing here. I believe that for the client GUI, you only have two fields you need to search on. But on the server side, you should ensure that the search facility can search on any combination of critera, not just the two specified columns.

do you think I should display all the records on the screen when the client application first starts up?


Design decision time - don't forget to document it.
It can be very nice, and with the few records we have, it is not a huge drain on resources.
But how many records are too many? (quite a lot actually since the records are so small).
Regards, Andrew
 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic