Xojo2024R1: setting dynamically WebListBox to display fetched records from PostGres

I am looking for suggestions and/examples. The situation: web page having single WebListBox used to display data from PostGres database using various queries that return data (user selects the “report” to run). The objective is to present fetched records on the screen as a list.

In original web app using Xojo2018 data is retrieved quickly and presented on the web page using WebListBox with dynamically added columns and rows.

In Xojo2024R1 the similar code is not as fast, large sets of data (like over couple of hundred rows) are making the web page unusable. There seems to be a limit in terms of number of lines that WebListBox can handle efficiently.

In Xojo2018 the code is fetching data using RecordSet. I think in Xojo2024R1 the code should maybe use RowSet instead, not sure if this would make much of the difference though.

Is there a better way to present large sets of records (rows) other than WebListBox?

Have you tested the examples that come with Xojo about WebListbox anda DataSource?

That’s the preferred way to pull records from the database.

actually the 2.0 weblistbox has been made to handle fast a big amount of records …

Well, that is what I thought but somehow older Xojo2018 version is faster. Then again, I am still learning hence my question.

I was thinking about creating new web page using DataSource, however, I am not sure this will solve the problem though. I would like to hear if anybody is actually using this approach with larger data sets (over 1K).

One of the approaches is to use retrieve records in smaller sets and have Previous/Next button fetching them. We use this approach with underlying data list. I think though that the dynamic changing of the WebListBox (various queries fetch various number of values per row hence the WebListBox gets different number of columns each time) is getting slower as the number of rows increases.

DataSource allows lazy-loading.
If you scroll fast it will take some time to load the new retrieved information from the database.
It just keeps reloading the information needed as you scroll.

I made my own table with access to my databases using a websdk
it was years ago when weblistbox 2.0 was really young and bad.
so I’m still using this websdk now and I’m really happy with it **!

**: except some specific css for displaying a fixed number of lines in the table that does not want to work but I will someday fix this…

Here is a sample project I got from @Ricardo_Cruz that was helpful to me. I suggest modifying the project to connect to your database for testing. Dropbox

1 Like

Thanks for the example, I will see if I can clone/modify it into the app and see any difference.

Using a WebDataSource is the way to go, when you want to display something larger than a few hundred rows.

With 2024r2 it will be even faster and easier to integrate (it will require less methods). I’ve did a demo in the latest MBS conference displaying 1 million rows in real time.

3 Likes

Ricardo, this sounds very promising, I assume the 2024R2 is just around the proverbial corner (end of June?). Btw, I was going to go to MBS conference but had conflict.

Xojo does not provide dates for future releases, but you can see past releases dates:

  • Xojo 2022r2 - Released: July 25th, 2022
  • Xojo 2023r2 - Released: August 9th, 2023

from: https://xojo.com/download/archives.php

Is this change going to be backwards compatible or will existing implementations need code updates?

It’s backwards compatible. The old methods that aren’t used anymore in the WebDataSource interface won’t be called, but other than that, the project will continue working without having to update it.

5 Likes

You rock.

4 Likes

Alberto, no doubt nobody wants to commit to any date, but I am just assuming approximate end of 2nd quarter as the R2 release date. The couple of weeks “here and there” will not make much of the difference as long as the feature works as advertised and makes the Xojo better.

I would have plenty of suggestions for IDE improvements btw, one of them being able to do method rename by clicking for second time on the name and have the name be editable right there, this would allow typing over and get the new name, no need then to look into the upper right corner of the window. Drag&drop of the method name in the method name tree to reorder as needed (just second example). But at this point all I need is the quick and easy way of using WebListBox.

I am sure Xojo will be better with each release.

WebListBox combined with the WebDataSource interface is already delivering great results. 1000s of rows shouldn’t be a problem with the current version. Please give it a try, you won’t regret.

You can add all your feature requests here: issues.xojo.com

If you have a current license you may be part of the pre-release testers group. Maybe this information is still valid:

1 Like