WebListBox DataSource Reload Finished Event

Is anyone aware how to check that the weblistbox has finished re-drawing new content? I can simulate it quite precisely with a timer, but not good enough in case a query doesn’t return many records.

I assume that the framework knows when it created the last visible row and that it could potentially fire an event?

1 Like

It would be really nice to have this feature. Maybe @Greg_O_Lone can shed some light on this.

Most likely I was not specific enough. If we populate our listbox via Datasource, we will reach the point in our code, where we are adding our las row. That’s the last chance (before the framework takes over the work of building the listbox and showing it) where we can fire an event ourselves and for instance stop a progress wheel which we started at the beginning.

But unfortunately in complex weblistboxes there might be another delay of 0,5 to 1,5 seconds until the new entries actually show up in the weblistbox.

Of course I can predict "the end of this “build process” approximately and for instance call a timer which we only kill the progress wheel 2 seconds later. But depending on the query the user triggered 2 seconds might be too long or not long enough. Hence the question if anyone is aware of a way how to find out when the listbox finished drawing al the entries. If nothing exists the remaining question is, if it is possible to file a feature request for this, or if the framework itself will never know when the browser has finished its drawing …

If nothing exists the remaining question is, if it is possible to file a feature request for this,

There is one way to know :wink:

The problem is that WebListBox doesn’t ever really “finish” loading.

When you first add data or call the ReloadData method, a signal is sent to the browser to tell the listbox that it needs to load data. What it does is it loads about a screen’s worth before, on and after what the user is currently viewing… but it doesn’t ever load the whole thing at the same time. When the user scrolls into an area where no rows have been loaded, the listbox requests more data from the server and discards some of what it had before.

1 Like

I understand, this makes sense - but too bad.

The challenge I’m facing is that customers are opening tickets, stating that they are seeing a “curtain” and that something is “broken”, but all the sudden it is working again :slight_smile: … Would it be technically possible to show a small message? Like the tooltip? Or showing something a user recognizes. A progress wheel would probably show more clearly that the system is just busy …

i think we as technical people just don’t understand those users, but for them it obviously looks like if the system crashed and that they destroyed something ,…

Have you tried setting the “No Rows Message” ? Since you know if you’ve added rows, you may be able to use that as a “Loading” message when there are rows present.

Just out of curiosity… what kind of a delay are they seeing?

< 500 ms, but noticeable when you want to scroll down a large list with 6000 items in the worst case (bad selection). Compared to “Excel” it is “slow” … I will try later with this “No Rows Message”. Honestly I noticed that but never looked at it, as I always have “some rows”, good hint!

Oh well yeah, I could see there being a delay in that case. it’s requesting the data from the server.

1 Like

Plus I’m WeblistBoxImageRenderer on a few columns … :-). Homemade first world problems …

I experienced this first hand yesterday. The WebListbox had a small dataset (sub 100 records) with only one column (albeit a tall one with multiline data in it) and I continuously had the curtain appear not just at the bottom but also the top of the WebListbox and sometime had it failed to load in the data at the top until I messed around with the control by scrolling back and forth to eventually get it to load. I do have a feature request to have the control simply load in all of its data. I’d much prefer this with pagination options like in Web1.0

1 Like

Yes, I initially thought, the weblistbox would only load “missing” data while scrolling down. This is something a non tech savvy user could understand (or at least he will get used to it). But seeing the same “curtain” when scrolling back up … that’s a really an unusual behavior. Plus I think that the “curtain” doesn’t look very nice (to stay polite on this forum :slight_smile: ).

@Greg_O_Lone to endorse @Brock_Nash experience, below a life example.

Granted, this is a slow $ 5 server, I’m exaggerating it a bit in the list box, but you can see what I mean. I think it would be nicer if you got a hint while scrolling down or up, something simple like “Loading …”, or “Working” etc.

Alternatively, an event would be nice that you could react to with a timer. But since we want to avoid too many events, it would be better if the framework would do it itself.

https://xojodocs.com

Thank you, for your consideration.

2 Likes

Yeah, an event would be too late. You’d get it at the same time as the request for data and it would get to the browser after the new data was received.

I think the control allows for a message or an icon. I’ll have to look into that though.

1 Like

I hear you, that’s what I expected, but I still had hope :-).

That would be fantastic … Icon would probably even be better than a message, as otherwise, users want to get it translated.

From my real customers (not from the above demo app), I got the feedback that they are puzzled by the “curtain”, looks to them like something is “broken”. They are just no techie people, and I understand them somehow, but more importantly: I can’t mentally cope with their tickets any longer “something is broken” :slight_smile: .

In a possibly related issue, I am getting a “Query still in progress” error when I try using the WebListBox.ReloadData function… could this be because it isn’t “finished” loading and therefore causing the exception?

Any ideas?

Ok, the workaround for my issue is to reset the datasource for the listbox… You can use the same source again, just set it again. Reload is not working, giving the “Query still in progress” error.

hth someone.

“Query still in progress” would be coming from your database connection. You may not want to use the same exact database connection for each query if you are running into this.

1 Like

Hi Greg,

Thanks for the reply! Yes, that’s that I found for the error, but still scratching my head.

The error is coming in the RowData method, during the select:

If filter = "" Then
  rs = Session.platedDB.SelectSQL(sql)
Else
  rs = Session.platedDB.SelectSQL(sql, filter + "%", filter + "%", filter + "%")
End If

I have tried different connections, with different names, new connections on each call, etc. and still get the error when the Reload() method is called, even from a button that does nothing else, yet don’t get it if I just reset the DataSource to itself, which is how it was set on creation:

Dashboard.ListBox1.DataSource = Dashboard

I’ll poke at it a bit more and report back, but for now I have a workaround. I’ll see if I can replicate with the example app.

Thanks!

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.