Skip to content
Advertisement

“Show deleted” checkbox not working as intended

I’ve implemented a soft delete behavior in my imaginary Video rental app, and now I am trying to implement a way to reactivate my “deleted” customers, but I can’t get my approach to work, surely something simple, but google did not let me find the answer, so here I am.

Here is an excerpt from my repo interface (JpaRepository):

JavaScript

In my service class I have:

JavaScript

And an excerpt from my listview class looks like:

JavaScript

But obviously there is something wrong in the listener part, or there is a silent “sure we want to help feature” that I am not aware of. Because the updateList function is not executed. What have I missed?

Advertisement

Answer

The problem lies in the implementation of your updateList method.

No matter if the value of the checkbox is true, at the end it always sets the items again that are returned by service::findAllMovies.

move the last statement into an else block and it should work.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement