Update webpage in event

Hello

I have a situation where I need to update a webpage in an event. But how do I force Xojo to push the new GUI to the browser?
I have a setup which boils down to this:

Public Sub DoSomething DoSubSomehing1() progressbar.value = progressbar.value + 1 DoSubSomething2() progressbar.value = progressbar.value + 1 DoSubSomething3() progressbar.value = progressbar.value + 1 DoSubSomething4() progressbar.value = progressbar.value + 1 DoSubSomething5() progressbar.value = progressbar.value + 1

The function DoSomething is called in a webpage.Shown

But now, the page loads and refreshes to a full progresbar. How do I ‘fix’ this?

[quote=363671:@Mathias Maes]Hello

I have a situation where I need to update a webpage in an event. But how do I force Xojo to push the new GUI to the browser?
I have a setup which boils down to this:

Public Sub DoSomething DoSubSomehing1() progressbar.value = progressbar.value + 1 DoSubSomething2() progressbar.value = progressbar.value + 1 DoSubSomething3() progressbar.value = progressbar.value + 1 DoSubSomething4() progressbar.value = progressbar.value + 1 DoSubSomething5() progressbar.value = progressbar.value + 1

The function DoSomething is called in a webpage.Shown

But now, the page loads and refreshes to a full progresbar. How do I ‘fix’ this?[/quote]
When you write code in a single method like that, all of that code is executed and whatever the end result is what is sent to the page.

There are two ways to deal with this:

  1. Use a WebTimer to execute each of the processes in sequence, one per firing of the action event.
  2. Use a WebThread to do the data processing and a WebTimer to send progress updates to the browser.