B4A Library [Lib] UltimateListView

Dave O

Well-Known Member
Licensed User
Longtime User
FYI, buttons can do Material icons just like labels do - set the typeface to Material, then set the (Material) character in the designer or in your code.

More to the point, I use ULV in most of my apps, so I'm happy to investigate further if you can upload a minimal project with that bug.
 

Dave O

Well-Known Member
Licensed User
Longtime User
Probably the problem is in the part where you fill in the ULV. Maybe you don't create a new Label (Dim) inside a loop for filling.

One easy thing to miss with ULV is in the ContentFiller sub - you need to give explicit values to every field in the item, every time.

Otherwise, when that item slot gets reused by another item that uses the same layout, values from the old item will still be there. That's caught me a few times.
 

incendio

Well-Known Member
Licensed User
Longtime User
Here is the sample project for that problem.
 

Attachments

  • Test.zip
    12.4 KB · Views: 187
Last edited:

Dave O

Well-Known Member
Licensed User
Longtime User
Here is the sample project for that problem.
Thanks, found the problem. Your ContentFiller (Tbl_Content) is using the Position of the item in the list as your DB cursor. You should be using the RowID (in your case, RowID - 1) instead.

In your example, the three items have IDs of 1, 2, and 3. If you delete the middle item, the listview now correctly contains rows with ID 1 and 3, but when you go to the DB to get that data, you're setting the DB cursor to be the Position in the listview instead of the ID.

If you change this line, it works correctly:

B4X:
dbCursor.Position = RowId - 1

BTW, this particular line only works because the IDs start at 1, but you get the idea.
 

imbault

Well-Known Member
Licensed User
Longtime User
Hello @Informatix,
Just a question, does your UtimateListView library can be used in an App using the B4XPages framework?

Thanks a lot
Patrick
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…