Hi everyone.
I’ve started using the StartTask function, it works well in terms of async.
Code i use:
Application.StartPolling(1000)
Application.StartTask(Function()
TryCatch ex As Exception
End Try
End Function)
Application.Update(Me)
Application.EndPolling()
However, for some reason, when i execute this, the form doesnt update, i need to click in something to make the form or page update, to fix this i had to add a timer always enabled with the:
Me.Refresh() and Me.Update() , however this is not the best option to fix this error. Can someone help me please? Basically it gets stuck until i clikc with the mouse or hover a control, or resize the chrome etc.
Hi Ruben,
Background tasks are completely separated from the session and the user that started them. They are simply threads running on their own without any knowledge of the session that started them.
This is why you’ll need to update the application to reflect any changes or updates done in a background task.
For this, Wisej has the “Application.Update()” method.
However, in order for it to work correctly, you’ll have to add the method INSIDE the Application.StartTask() method.
Otherwise, when the task is finished doing its thing, it won’t get reflected back to the client.
You can find out more info in our documentation : Wisej Documentation | Updating UI Using Background Tasks
HTH,
Alaa
Please login first to submit.