• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S: Questions on JComboBox design

 
Derek Canaan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My current plan is to have 2 JComboBoxes for the name and location fields because it is easier to use (compare to JTextFields) and i don't to have to worry about case-sensitivity, and invalid entries.
The problem with this plan is:
Suppose the original db file has location 'New York'and later some other application adds to the db file a new locations 'new york'.
Q1: Should i interpret these two entries as different locations. If so, my location combobox will have two choices for the same geographical place! Is this ok? Implementing location JTextField will not have this "visual" problem.
Q2a: Since assignment allows only book and search, is it ok to populate the JComboBox *ONCE* at the start of the client application and forget about it.
Q2b. Or should i refresh the JComboBoxes everytime the 'search' button is clicked or when the table is refreshed. This caters for database being updated by other applications otherwise the items in comboboxes will be stale.
Any advice?
Thanks,
Derek
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. No
2a. Yes that is fine.
2b. No
Just realize that the assignment does not require having an entry screen. so really in this assignment no new records will really be added.
Mark
 
joe black
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if the user wants to view all records, or just perform a search on one of the two fields?
[ December 22, 2003: Message edited by: Joe Black ]
 
Derek Canaan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe,
What if the user wants to view all records, or just perform a search on one of the two fields?

This is my plan.
1. User wants to view all records:
The name and location combobox each has an wildcard item "any name" and any location" respectively. User selects these and click on the "Search" button to view all records. This suffices for standalone mode.
But i plan to have an additional button "Refresh Table" to facilitate "user-friendliness" for network client mode. Suppose User A wants to book Contractor 1. He highlights Contractor 1 and presses "Book" button. However, he was a fraction too slow. User B booked it just before User A pressed "Book". User A will get a pop-up message box that states "Contractor 1 has been booked. Please refresh table and select another". So the "Refresh Table" facilitates that. He could have refreshed the table by choosing the wildcard items in the name & location comboboxes and pressed "Search" but this takes more steps.
2. User wants to just perform a search on one of the two fields?
Without loss of generality, suppose he wants to do a search on name. He selects one of the items in the name combobox and choose the "any location" wildcard item in the location combobox.
Hope it helps.
derek
 
joe black
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice
 
Derek Canaan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,
[Derek]: Suppose the original db file has location 'New York'and later some other application adds to the db file a new locations 'new york'. Q1: Should i interpret these two entries as different locations.
[Mark]: No

So i should interpret them as same location. Does this mean that on the server side, findByCriteria returns two record numbers, one for 'New York' and another for 'new york' and an adapter class filters them and returns just one record to the client's gui? So the search method in the adapter will have to use String.equalsIgnoreCase() instead of String.equals().
Is this what you mean?
thanks,
derek
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic