• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

breaking user's hand and heart too....

 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the users are given 3 combo boxes origin, destination and
carrier. when the user selects 1 combobox only that
criteria needs to be sent. but in the
getSearchString() of the view i can't say
combo1.getValue()+ combo2.getValue +combo3.getValue()
instead i would say
String searchString="";
if combo1.getSelectedValue() !='ANY'
searchString +=combo1.getValue()
if combo2.getSelectedValue() !='ANY'
searchString +=combo2.getValue()
if combo3.getSelectedValue() !='ANY'
searchString +=combo3.getValue()

am i correct on this.
if i am passing combo1+combo2+combo3 ,then it will
return all records. in a way,i am forcing the user to
select all the combos [breaking user's hand ]
am i on the correct track ...

pls let me have ur esteemed comments
 
Eric Blische
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aadhi,
On my UI there is only a combo box to
select the Departing Airport and Arriving
Airport (no carrier). My combo box model
is populated initially from the database,
and an additional value "any" is added as
the first (default) combo box "selected" value.
So by default, a valid query (arriving=any and
departing=any) is available w/o any interaction.
I didn't think selecting carrier was necessary-
when I book a flight, I want to see all the flights from point A to point B, then pare down
the results by flight time and carrier. Anyone
else have an opinion about the Carrier?
Eric
 
Ben Ritchie
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carrier isn't explicitly required - the requirements just say that

The user should be able to select the origin and destination of flights, and the display should update to show only flights that satisfy those criteria.

However, I included it - it doesn't say only origin and destination, their search example uses Carrier, and adding the ability to search for Carrier is almost no work once you've coded for Origin and Destination.
[ March 01, 2003: Message edited by: Ben Ritchie ]
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
i am staisfied with making the search criteria using the combo boxes. i will IGNORE the combo if it is having any . means that , i wont pass the criteria for the combo if it is "ANY".
but i am having some terrible problem with the text field (advanced search).

why on earth should the user has to say Carrier="ANY" if he he is not bothered with the Carrier . in other words, if the user doesnt bother to narrow down a criteria, let him NOT ENTER it for God's sake. i hate to code "ANY" in my Data which is 100% reusable. coming to the point, would i be graded less for asking the user to omit the "ANY" for advanced search.

i am supporting it for the combo box way of forming the query. please help!
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ONLY feasible option i can think of is, before passing it to the controller, parse the text field value and if it contains "ANY" as the value , reformat the query!!! IMHO, entering ANY for a field restriction is tooooo much!! why should someone do it. pls throw some light on this!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic