Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS 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

ComboBox or TextFields for Search functioniality ?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was asking me what approach for providing the search functionality is the better one:
a) Use textFields to enter origin and destination airport in search dialog.
b) Use drop down combo boxes for origin and destination airport in search dialog. These ones have to be prefilled with the available origin and destination airports then. An additional distinct like select function to retrieve the column values (loop whole db, fill Set, return set as String[]) has to be provided in Data class.
I believe the b) solution is more user friendly, but probably slower, because distinct select has to loop over whole db. It also increases complexity.
a) is the more simple solution, but probably does not satisfy the needs for a good GUI and HMI ?
What are your opinions on that topic ?
Thanks,
Marco
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
first of all I would implement a generic search functionality, which means does not depend on the underlying data model. Keep in mind the application should be extendable.
My approach was to use both comboboxes and textfields for searching flights. The comboboxes are dynamically filled with distinct values of the database. The search dialog can be configured in that way wether items should be comboboxes or textfields.
Hope this helps...
jay
 
Marco Machacsek
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
thanks for the answer. I have decided to go for the combo boxes only, because of the 'ease of use'. I have addded an
String[] selectDistinctValues(String fieldName)
method to Data class. This one has to be called two times to build DefaultComboBoxModel's on client side for origin and destination airport.
For me there are some possibilities now to solve the "any" option in GUI:
1) Add "any" to the comboBox drop downs
2) Add radio buttons that allows to switch between comboBox and "any" button. "any" option does not need to be in comboBox list anymore
3) Add checkbox besides comboBox. In enabled state the comboBox search criteria will be used and in disabled mode it will behave like "any", means this search criteria is turned off.
Cheers,
Marco M.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic