Portlet search by multiple parameters

I’m following this tutorial http://techcommunity.softwareag.com/documents/portlet_file_entry/10157/caf_search_app_tutorial.pdf/2209b019-6dff-4cc6-a2fe-2303abcc0c85 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.

HI Hara,

In your comments you mentioned of adding second “Then I added a second field - last name.”

  1. For results issue - You can run a restore pipeline to see the exact details your IS service is receiving.
  2. For the second field - Is this field present on IS and CAF? With the error of binding, it is clear that the new field is on UI. If you wish to remove it and unable to find it. Best approach is to open the view in TEXT view and search for the string.