• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strange case for criteriaFind

 
Lance Finney
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How should we handle the following input to criteriaFind: "Origin". The way I had my code written, it will ignore this entry and return all the flights. The instructions say "In the event of an invalid field name being provided as part of the criteria the behavior of this method is the same as if no records matched correctly specified criteria. " However, in this case, the field name is valid, but no value is entered. Do you think it should return all values or no values?
 
Amy Saari
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i used a combobox on the interface and loaded in all the
possible values - starting with 'any' -- so there's
always a value for origin and destination.
as
 
Lance Finney
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amy Saari:
i used a combobox on the interface and loaded in all the
possible values - starting with 'any' -- so there's
always a value for origin and destination.
as

I'm not using a combo box, but I have my client ignore an entry if the string entered is empty or "ANY". So, for this application, there's no problem. I'm thinking of reuse, though, and how the method should be designed for theoretical other clients.
Thanks
 
Yuriy Fuksenko
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used textfield, and leaving field empty gives the same result as typing ANY (not case sensitive). I just documented it in user guide and explaind reasons in Programer notes.
 
Gennady Shapiro
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The protocol explicitely states the format "Origin='***',Destination='***'". Anything other than that should not be constracted by client. If something like that gets constructed and passed to the server server should ignore invalid request and return an empty set.
Criteria "Origin", or "Origin=" are violations of the protocol, criteria "Origin=''" is valid but doesnt match anything so it returns no matches.
I hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic