Android Question B4XSearchTemplate - strange List-behavior - Bug?

Herbert32

Active Member
Licensed User
Longtime User
Hello together,

actually I'm facing a problem on which maybe someone of you can help me to solve this problem.

I use the B4Xsearchtemplate filled with 300 items which are shown in multiline correct until i start to type my search-text.

As soon as i type my search-text, the visible lines-count of each item are varying with each new character, I type in the search-field.

If you take a look into the attached pictures, the happend behavior should be clear, even if I did not found the exact words to explain🙈

WhatsApp Image 2024-11-12 at 11.13.17.jpegWhatsApp Image 2024-11-12 at 10.49.12.jpegWhatsApp Image 2024-11-12 at 10.49.13 (3).jpeg

Does someone have an Idea, why this happens and how i can solve this problem?

THX in advance
 

Attachments

  • WhatsApp Image 2024-11-12 at 10.49.13 (1).jpeg
    WhatsApp Image 2024-11-12 at 10.49.13 (1).jpeg
    114 KB · Views: 58
  • WhatsApp Image 2024-11-12 at 10.49.13 (2).jpeg
    WhatsApp Image 2024-11-12 at 10.49.13 (2).jpeg
    126.9 KB · Views: 47
  • WhatsApp Image 2024-11-12 at 10.49.13.jpeg
    WhatsApp Image 2024-11-12 at 10.49.13.jpeg
    139 KB · Views: 73
Last edited:
Solution
initially after .setitems all items are in the correct size - but after the first character in search-field the height of the items changes - also after removal of all characters in the searchfield the height of the items is different from original
I have no the items data, just extract them from your pictures. the behavior is you want? some characters or removal of all characters in search field the height of the items does not change.


1.png
2.png
3.png
4.png

Herbert32

Active Member
Licensed User
Longtime User
This is how the b4xSearchTemplate is working.
It lists all matching Entries.
yes - but it should not reduce the visible lines inside an item in the list of matching items

look at the first item, which starts with '1 Schutzgasschweißgerät....' :

typing 'bac' there are 6 lines visible
typing 'ba' there are 2 lines visible
typing 'back' there are 3 lines visible
typing 'backs' there are 2 lines visible
typing 'backst' there are 3 lines visible
 
Upvote 0

teddybear

Well-Known Member
Licensed User
yes - but it should not reduce the visible lines inside an item in the list of matching items

look at the first item, which starts with '1 Schutzgasschweißgerät....' :

typing 'bac' there are 6 lines visible
typing 'ba' there are 2 lines visible
typing 'back' there are 3 lines visible
typing 'backs' there are 2 lines visible
typing 'backst' there are 3 lines visible
Obviously, all of these items which shown contain the search key, some keys of them are just out of the visible range of the item. you can check them.
such as
item.png
 
Last edited:
Upvote 0

Herbert32

Active Member
Licensed User
Longtime User
Obviously, all of these items which shown contain the search key, some keys of them are just out of the visible range of the item. you can check them.
such as
View attachment 158556
yes - i know this - the value of the item is correct but the 'visible range', which i called 'visible lines' always changes for the matched items with each character i add to the search-field.

this for sure is not the expected behavior.

the user needs to see the complete text of each matched item to be able to select the correct one by touching the item in the list.

initially after .setitems all items are in the correct size - but after the first character in search-field the height of the items changes - also after removal of all characters in the searchfield the height of the items is different from original

i tried to modify b4xsearchtemplate.bas but without acceptable success.
 
Upvote 0

teddybear

Well-Known Member
Licensed User
initially after .setitems all items are in the correct size - but after the first character in search-field the height of the items changes - also after removal of all characters in the searchfield the height of the items is different from original
I have no the items data, just extract them from your pictures. the behavior is you want? some characters or removal of all characters in search field the height of the items does not change.


1.png
2.png
3.png
4.png
 

Attachments

  • 4.png
    4.png
    60.7 KB · Views: 24
Upvote 1
Solution

Herbert32

Active Member
Licensed User
Longtime User
i'm sorry - you are right - your modification works - at my first test i loaded a wrong template.

I made same modification by myself before - but at that time, i don't know why, it has been much slower by using

mod:
this:                        CustomListView1.AddTextItem(cs, item)
instead of this:            CustomListView1.Add(p, item)

anyway... - actally it seems to be fast enough

thank you for your kind help 👍
 
Upvote 0
Top