Weird problem in listview filterbar

With the Taifun TextBox extension by @Taifun, you can set a TextBox to a filter bar. By default, the hint of the filter bar is "Search list..." in the user's language, but you can avoid it by setting your own TextBox.

Here is an AIA for demo. In this AIA, I have a black VerticalArrangement and a black ListView, so we blend the ListView into the VerticalArrangement. I also have a TextBox, acting like a filter bar. You can customize the TextBox to whatever you like.

The variable global elements is the list of elements I want to show, and global copy is a "dummy" list that I will use to reflect changes in the ListView. When the screen initializes, the TaifunTextbox will start the text changed listener, and I will also set the elements of the list to global elements. In case if you only set the elements in the Designer and not via blocks, use ListView.Elements as the value for global elements.

When the user has deleted all of the text, we reset the elements to the original elements. Else, we show the most relevant elements. This ignores case, so "Abc" will be the same as "abc".

AIA: FilterBar.aia (20.0 KB)

You can download TaifunTextbox here.

In case if you want to extend the TextBox even more, like setting the hint color, use TextboxUtil.

2 Likes