Web Connection
Showing Progress Spinner
Gravatar is a globally recognized avatar based on your email address. Showing Progress Spinner
  Phil Sherwood
  All
  Sep 4, 2017 @ 08:12am

When I'm generating reports I want to show a spinning icon to show that processing is going on. Some reports might take a minute to complete. I'm currently calling expandscript from a link on the page that links to a page that has all my layout and the content is just:

<i class="fa fa-spinner fa-spin" style="font-size:72px"></i>   

Even though it takes a minute, it never shows that page. The sequence is:

response.expandscript("~/views/_spinner.wcs")
pcReportHTML = oReports.BuildData(lcTenant,"tReports",lcWhere,"Revenue and Expenses by Accounting Year") && This takes a minute
Response.expandscript("~/views/_reportprev.wcs")

What am I missing?

-Phil

Gravatar is a globally recognized avatar based on your email address. re: Showing Progress Spinner
  Rick Strahl
  Phil Sherwood
  Sep 4, 2017 @ 10:10am

No that won't work... You can't send multiple responses into the HTTP result stream. Plus Web Connection only sends results all at once - anything you write to the Response stream is cached until the final string is ready to be sent to server.

Rather, you need to handle any progress display before the new page is rendered in the browser, before it sends a response and its first bytes to be displayed.

The way this works is:

  • Make sure you have a form with an id tag so you can ref the form
  • Create form submit() handler that intercepts the form submission
  • Use JavaScript to display what you want to display for the progress display

Ping me later and we can quickly hook this up to a form of your choice.

+++ Rick ---

© 1996-2017