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.
You dont 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=361386:@Greg O’Lone]You dont 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 doesnt have an UpdateListBox method. webPage1(CurrentPage) tells it to treat is as such.
[quote=372409:@Greg O’Lone]Because CurrentPage is of type WebPage, and a generic WebPage doesnt 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.