Xojo2024R2 WebListBox with DataSource - list goes blank

I have just downloaded newest release Xojo2024R2, it looks like the WebListBox control with DataSource is showing data from Postgres database very quickly - this is very good. I have added code to cache row count for the query I pass to the TableDataSource.SetQuery, this makes the RowCount access database only when I send new query eliminating issue of open queries when scrolling up/down. However, I have just noticed that there are still issues.
My query returns large number of records, over 150K, so when I scroll up and down quickly I get to the point when the list gets blank. I am on Mac M1 using Safari and I use regular mouse with the wheel. I notice this issue when I drag down/up vertical scrollbar and follow by moving mouse wheel. The list box gets blank, the vertical scrollbar disappears. I can click the button to re-run the query and the list will populate.

So, with so much improvement there seems still to be an issue.

I am sorry for reporting this what appears to be a bug, perhaps someone can confirm. I think, the key to replication is to use backend database with large data set returned.

I was Web app developer for many years, though not with Xojo Web, I can tell you from experience no matter what the back end is - pretty much every browser is going to struggle to render 150k+ rows of data in a smooth and orderly fashion.

I don’t think this is a Xojo problem, necessarily.

I would suggest you look into data pagination, like in this post: Need help with paginating data in weblistbox

Now that 2024r2 has been released, I can share this example of a WebListBox displaying 1 million rows, from SQLite:

Take a look at the project to see if you can find what could be preventing your WebListBox to work as fast as that one.

Could you try opening the task manager and see what’s causing the bottleneck in your project? Is it Xojo? Is it the Database?

6 Likes

Scott, I don’t disagree that fetching 150K records into the list is a lot, however I was told not to use LIMIT/OFFSET on the query passed to the DataSource class.

The old Xojo2018 based app (that I have converted to Xojo2024) was using pagination with some pages, that is what I have actually preserved in the newer version too, basically fetching 100 or so rows at a time, with Previous/Next buttons.

The problem with the old approach is that it requires underlying data list that goes out of synch when user clicks on the column heading to sort the list using WebListBox. I have figured out the way to work around this problem.

However, I am under impression that I should really use DataSource with WebListBox instead going forward. This now presents the problem of how to use the pagination with it. I am open for all suggestions and new ideas of course. I will check the link, thank you.

On the other hand, it appears that the problem is manifested itself when I move the wheel on the mouse right after doing up/down scrolling. I can certainly stay away from this and warn users of this web app to do the same.

1 Like

If you look at the source of the project @Ricardo_Cruz has provided (above), it looks like it has some DataSource code that accepts limit/offset parameters. You might be able to do something with that.

I appreciate you being open minded to suggestions @Grzegorz_Greg_Pasternak . Good luck :slight_smile: