Why do my search not work (follow up question)

Hello, 


I try to implement that a user can search in the database for a movie. So I thought I implemented it right but now no movies are shown even if you enter a title which is avaible in the database.


What did I do wrong this time ?


Roelof


Hi Roelof,

Could you show us how you implemented the search or share your oml file so that we can take a look?

Kind regards,

Glenn

Hi Roelof,


I understand your issue. Maybe there is something wrong with the filter.

 However, can you share an oml so we can see what is going wrong?


Best Regards,


João Delgado

sorry. I thought that I had included it. 

Solution

Roelof, 


Do you want to have an OnChange action, or you want to write your text and then hit the button to search?


Replace your Fetched Data filter with this :

SyntaxEditor Code Snippet

Film.Name like "%"+SearchKeyword+"%" or SearchKeyword = ""

And also, create an action associated with your Search button that will refresh your data. Or, in an action associated with the input change.

You just need to replicate the above action and you will have it working perfectly.


Best Regards,


João Delgado

Solution

Roelof Wobben wrote:

sorry. I thought that I had included it. 

Hi Roelof,

After taking a look at the oml you added I've noticed you were missing a few things:

1. Make sure you have the correct action added to the event: (It used to be an unexisting action called SearchOnChange)

2. Make sure your action refreshes the data:

3. Make sure your filter is correctly defined: (Example below makes sure it'll show all movies if no keyword is filled in)


Can you check on these 3 points and try again?

It should work now.

Kind regards,

Glenn

both thanks.


it worked now. 

Maybe it is handy to make something to reset the filters but that schould not be a problem now.

Roelof Wobben wrote:

both thanks.


it worked now. 

Maybe it is handy to make something to reset the filters but that schould not be a problem now.

To reset the filters you could just use a button with an action behind it that resets the filter variables to their default value (in this case "").


Roelof,


If you remove the button and only work with the onchange event of the text input you don´t have that issue.Since that when you delete your searchkeyword, the fetch data will show you all available data.


If you want to work with buttons, you should create a second button that can be named "reset" and will do the following process:

This means, it will assign (SearchKeyWord = "") and then will refresh the data.


Best regards,


João Delgado