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
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
posted 17 years ago
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.