Multi-User Web App with Instant WebListBox Updates From DB

Hi, I am currently evaluating Xojo and working on a web application.

My question is: I need to display a grid/weblistbox with vehicles and statuses, and it must be updated almost instantly if another user of the application updates a vehicle. I was considering websockets, but was not sure if Xojo uses that yet for web applications. I also was considering a notify event from a database (ie PostreSQL) but was not even sure how that would be supported in this setup.

I am open to pretty much any database backend.

Thank you!

Ok, so I apologize. I have been only been playing with Xojo for about an hour and apparently missed the whole PostreSQL notify event is included.

So, I will amend my question - is this a recommended option?

Thank you
Chris

You don’t need anything special. Make a method for refreshing the listbox on the WebPage. Then a method on Session that checks is CurrentPage is the page where the list is displayed. Then add a method on App which cycles through the sessions and calls the method.

Now, when a user makes a change, just call the method on App and the updates will be pushed out to the other sessions.

Here’s an example of what I’m suggesting… PushingUpdates

wow. got a tips here. :slight_smile:

[quote=361386:@Greg O’Lone]You don’t need anything special. Make a method for refreshing the listbox on the WebPage. Then a method on Session that checks is CurrentPage is the page where the list is displayed. Then add a method on App which cycles through the sessions and calls the method.

Now, when a user makes a change, just call the method on App and the updates will be pushed out to the other sessions.

Here’s an example of what I’m suggesting… PushingUpdates[/quote]

Greg,

In the above download, why is the Session method

If CurrentPage = WebPage1 Then WebPage1(CurrentPage).UpdateListbox() End If

as opposed to just

If CurrentPage = WebPage1 Then WebPage1.UpdateListbox() End If

Because CurrentPage is of type WebPage, and a generic WebPage doesn’t have an UpdateListBox method. webPage1(CurrentPage) tells it to treat is as such.

Although it should probably be

If CurrentPage IsA WebPage1 then

[quote=372409:@Greg O’Lone]Because CurrentPage is of type WebPage, and a generic WebPage doesn’t have an UpdateListBox method. webPage1(CurrentPage) tells it to treat is as such.

Although it should probably be

If CurrentPage IsA WebPage1 then

Ah. That took a while to digest. Session.CurrentPage is of Type WebPage, like what I’m typing on right now; whereas, WebPage1 is of Type WebView, a way of viewing a WebPage. And it’s a WebView that has a method that does stuff.

Not only is it a WebView, but it’s a particular subclass of WebView named Webpage1. “Webpage1” is both an object in the IDE and a class, as well as a function that returns the current instance. There are several things named Webpage1 in your app. It does get a little confusing.

I also assume that the App.RefreshAllLists method here, which is

For i As Integer = 0 To SessionCount-1 Session(i).UpdateListbox() Next

should be

For i As Integer = 0 To SessionCount-1 SessionAtIndex(i).UpdateListbox() Next

Yes