47404 - Web App - Add running JavaScript before Event Handler or Method

[quote=321364:@Greg O’Lone]This would require a fundamental change in how responses are sent to the browser, and would likely break everything.

What you are suggesting is no different than putting your long running code in a WebThread and then just doing two things:

Spinner.Visible = True LongRunningCodeThread.Run[/quote]

Unless I’m really unclear on how Xojo web works, I don’t think this is necessarily a fair comparison.

In Xojoweb’s browser-side javascript library, it would seem that a shim could be inserted where, if desired by the app developer, a javascript command could be called immediately prior to the normal call back to the server.

I could see how there’s an increased risk to stability if the call did something unexpected. But a browser-side call is much more immediate and a better form of user feedback that waiting for a loop back from the server (which we find disappointingly slow sometimes - the delay is just on the edge of ‘did it get my click’ timing). Your suggestion also requires a more complicated thread or timer-based response when in many cases we could do a normal DB lookup or something in a reasonable amount of time.

If specifying a javascript call is inadvisable, perhaps an option within the framework where a developer could specify a busy indicator control/element of some sort (provided by the developer) and the browser-side framework could show it when calling back to the server and hide it when a response is received? - though I guess this might not work based on the long-pull technique Xojo uses…