Oh. You mean the message that you get when the app is stopped ? “The application has gone off line” ?
But why would you stop the app outright ?
I tried to place a showurl in session close, does not work.Maybe you want to wait until the user has ended his session before killing the app. Otherwise, I do not know what else to try.
Yeah I could do a showUrl on all active sessions, but for now I just want the app to redirect on disconnect.
I can see in xojo’s famework.js it shows a “preventInteraction” method which executes when the server is quit, is there any way to add a piece of javascript to this framework to do something like window.location = “newpage.html”; ?
[quote=132310:@Tyler Durden]Yeah I could do a showUrl on all active sessions, but for now I just want the app to redirect on disconnect.
I can see in xojo’s famework.js it shows a “preventInteraction” method which executes when the server is quit, is there any way to add a piece of javascript to this framework to do something like window.location = “newpage.html”; ?[/quote]
Greg O’LOne has many times warned against hacking the framework. Though what you describe seems the good syntax you would need to experiment to find the proper place to do it. There are several methods : http://ntt.cc/2008/01/21/5-ways-to-redirect-url-with-javascript.html
He describes the method for cgi, but it works fine for standalone as well :
Monitor in a timer if the app executable is still here. If the file does not exist, then the app quits all sessions so it can be upgraded.
What you could do is kind of the same thing, except that you do not stop the app, you delete the executable, and when the app finds out, it cleanly quits, and before it does, it takes users to an HTML page.
If you open the docs for the WebSDK, we fire an event just before showing the disconnected overlay on the XojoSession element (Section 6, Page 22). If you listen for the event, you can redirect to another page, something like this:
You’ll want to use the WebSDK so the SDK methods get added to the page, and then make sure you use Xojo.addListener instead of document.addEventListener because our framework has automatic fallback for IE and browsers that don’t support custom events.
[quote=132301:@Michel Bujardet]Oh. You mean the message that you get when the app is stopped ? “The application has gone off line” ?
But why would you stop the app outright ?[/quote]
One reason I found out the hard way was the database, MySQL, had stopped. When I tried to connect the application crashed, which is not good. So after the error message I ‘quit’ the Session.
I had a OS X and server update that went bad; I did not know it was bad at the time.