Clear List View Filter Text

Is there a way to clear the text in the ListView Filter?

I can see there are properties for changing the filter text size, filter text color, and a bunch of other stuff. There does not seem to be a way to clear the ListView Filter text.

When returning from a different screen, after a possible database update where the elements of the list view could possibly have changed, regenerating the elements list, there may still be text left over in the filter that is not applied to the list. Is there any way to clear that text?

Barry.

Are you using Kodular’s ListView component with Show Filter Bar enabled ?

1 Like

I don’t think so the text will be static… if you have migrated to diff screen then automatically the search text box will clear I hope.

1 Like

Yes, the Filter Bar enabled is true.

I’ve also played around with disabling then re-enabling the filter bar to see if text is cleared – it’s not.

I would’ve thought when changing to a different screen and coming back that the filter bar text would clear.

Filter is cleared when you change screens. Can you provide a screenshot or a short video of the problem

1 Like

Here is a video showing the ListView problem.

At first it shows Screen1 with a ListView with filter bar populated with the two items of a database.
I type in “new” into the filter and it changes the display to show only the second record.
I then hit my “Edit” button and it changes to the detail view on Screen2.
On Screen2 I click my “Save” button to return to Screen1.
Notice the filter text still shows “new”. Also notice that it now again shows both items of the database (I have re-created the list elements) not applying the filter to the displayed list.

can you show your blocks? it is seems to be that you are opening diff arrangement in the same screen

Suppose if you are opening correctly the next screen then your prev screen is not closed properly.

try like this…

1 Like

Thanks. I gave that a try, closing Screen1 when I “open another screen” for Screen2.

It does work, the filter text ends up being cleared, but there are artifacts of doing this:

On Screen2 I have to also “open another screen” to get back to Screen1. I can no longer use the “close screen” block to return.

In closing Screen1 I lose other variables that have been set on that screen and it seems like controls (such as the ListView) are reinitialized. The first time an element is selected on a newly initialized ListView It seems to take an extra second or so to “select” that element.

“Stacking” screens is the way Android seems to have intended. You “open” a new screen and “return to” the previous screen. Look at the Chrome browser on Android. When you close a page it returns the previous page (each page is probably implemented as an activity). Apps in general – when you close an app it returns to the previous app.

It seems to me the real solution is to offer a way to set or clear the text in the filter of a ListView. The code that is run internally for the control then needs to run to implement the filtering change of the ListView.

Barry.