Client page update?

0
0

Hi all,

I’m still new to wisej so forgive any silly questions.

I have a simple desktop app. performing some work in a BackGroundWorker.
Every so often the bgw calls a ProgressChanged and updates values in some labels.

However, although the background code is running, the labels aren’t updating/refreshing like they would in a traditional desktop app.

I expected them to just update. What am I doing wrong?
Am I going about background processing completely the wrong way?
Should I use Application.StartTask instead of a BackgroundWorker?

Thanks

Darren

  • You must to post comments
0
0

In the web world servers have no way to update the browser without a request initiated by the browser. And background tasks (threads) have no connection to the the client. Wisej uses a websocket connection to allow the server to push the updates to the client, but you have to have websocket supported by your server.

Try this:

http://demo.wisej.com/ProgressSample

There is also more here:

https://wisej.com/docs/html/BackgroundTasks.htm

https://docs.microsoft.com/en-us/aspnet/signalr/overview/getting-started/supported-platforms

  • Darren
    By the way, I think there should be an obvious note on your samples which warns about page refreshing. The sort example doesn’t appear to work on a win7 machine, for example… & this threw me. I thought there was something wrong with my pc! Quite a big issue I would have thought? Cheers
  • Luca (ITG)
    I don’t think I have see a Win7 machine in a long time! :)
  • Darren
    Ok. So, Are you saying we should ALWAYS use polling for background tasks – just in case? Is that a safe & legitimate thing to do?
  • Darren
    Win 7 is still very much used in industry. We still have to support it… like it or not! :-O
  • Luca (ITG)
    If the background task updates the UI and if you know that your client browsers may not support WebSocket then yes – but it’s under your control when to start it end it. On the server side you should always support it. If you deploy embedded wisej servers on W7 and the conditions above apply then yes. You can also simply use a timer component dropped on a form/page. There are several possibilities.
0
0

Hi,

Interesting. I just tried the wisej Sort example and this doesn’t refresh regularly either (on the same work machine).
I did try the sort program at home and this refreshed ok.

So, there appears to be something odd about my development PC!!!
I tried both in IE and in Chrome.

Any ideas, folks?

Thank you

Regards,
Darren

 

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.