I’m following this tutorial [url]http://techcommunity.softwareag.com/documents/portlet_file_entry/10157/caf_search_app_tutorial.pdf/2209b019-6dff-4cc6-a2fe-2303abcc0c85[/url] except that I’m using Database Connector to get the data from database.
I added one search criteria to find a person by first name, so I did everything like in tutorial, and I added a single condition to the database connector, it worked. Then I added a second field - last name. When I type John Doe and there is John Doe in the database, it’s gonna be found, but when I type John and leave last name empty (or type spaces) - I get no results even tho there are Johns in the database. I tried logging everything to find the reason, but all I found was “cannot resolve #{myConnector.lastName}, MyConnector doesn’t have property lastName” and then I tried to log query from “getQueryString” method, but it was encoded in Base64 or something, tried to decode it and it was just a java full class name. I added both search criterias correctly since typing John Doe works and the last name is taken into account.
I have no idea how it works behind the scenes, even if is passes empty String from the empty field it should just return correctly. I’m using Oracle and when I query the database with “firstName=‘John’ and lastName=’ '” it returns all the Johns, I checked, same with NULL or just empty String. I’m guessing it sees that parameter contains only whitespaces or is empty, and it doesn’t even send the parameter to the ‘input parameters’ of database connector and whole thing fails, how can I prevent that?
I should mention that I wanna allow the user to search by first name only, last name only or both, so I can’t make any parameters required.