• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

And/Or

 
jhao wang
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In instructions.html:
"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. "
I use two checkboxs and two textfields to implement the requirment. I think there are 3 cases:
a). name
b). lacation
c). name and lacation
But someone else said that there is fourth case: d). name or lacation . What do you think about this??
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jhao,
I think you are Ok. There were long discussion about this issue.
We decided that providing opportunity to search by Location and search by Name is indirectly "OR" search. It wouldn't make any sense to enter both fields in search criteria and execute "OR" search.
Best,
Vlad
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jhao. I would avoid using the JCheckboxes and JTextFields. I would have JComboBoxes for both fields. And if the user selects values from both, then the query is an AND always.
Mark
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,
I would avoid using the JCheckboxes and JTextFields.I would have JComboBoxes for both fields

I would argue this point. In FBN assignement it is required to use JComboBoxes and it is explicitly said , that the list don't have to be updated if the database changes.
In URLyBird there is no requirement to do so. If do it, then we should find excuse not to update list of names/location everytime database changes.
Why are you not happy with JTextFields? You are the one who always said "Make it simple!"
And if the user selects values from both, then the query is an AND always.

I would argue it also:
If you use JComboBox, the user is not obliged to choose items in both JComboBoxes. You can leave an item in JComboBox lets say "any". In this case indirect "OR" search requirement is also satisfied.
Best,
Vlad
[ September 17, 2003: Message edited by: Vlad Rabkin ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In FBN assignement it is required to use JComboBoxes and it is explicitly said

Actually that isn't specifcally stated in the instructions.html.
Also JComboboxes are the easiest, because the user doesn't ahve to worry about how to spell what they are searching for, or put in invalid entries. With a JComboBox the user just selects values that are already there. JComboBoxes are also the stadardized way of displaying data like this in a user interface, it is considered preferred over the JTextField in this situation.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic