Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » [Neon] Client polling
[Neon] Client polling [message #1722047] Tue, 02 February 2016 13:37 Go to next message
Nejc Gasper is currently offline Nejc GasperFriend
Messages: 55
Registered: July 2014
Member
Hello,

After doing some client async stuff (really nice api btw), code:
        Jobs.schedule(() -> MainBox.this.doStuff().doSearch(x, y, false),
            Jobs.newInput().withRunContext(ClientRunContexts.copyCurrent())
                .withName("Job"));

the GUI does not refresh (it should inside the job), but IT DOES refresh after I click any other field since some field probably triggers the update.

So I remembered this part in Scout Mars/Luna in ClientSession

getServiceTunnel().setClientNotificationPollInterval(2000L);


which sets polling and it helped us fix these exact same issues.

Any way to make this work on Neon? It could also be that my approach is wrong and I should do async GUI update in a totally different way.
Re: [Neon] Client polling [message #1722054 is a reply to message #1722047] Tue, 02 February 2016 14:01 Go to previous messageGo to next message
Ivan Motsch is currently offline Ivan MotschFriend
Messages: 154
Registered: March 2010
Senior Member
would it be possible for you to enable log for org.eclipse.scout.rt.ui.html.UiSession ?

Reason:
In the webUI the long polling is done using a long polling javascript job.
Session.js: backgroundJobPollingEnabled default true.

this one is calling (as other ui clicks as well)
UiSession.processJsonRequest.

It could be of help to know if javascript long polling is on or totally off.

Since another click in the ui brings up the changes it seems that long polling is off.

What is your index.html?
Re: [Neon] Client polling [message #1722171 is a reply to message #1722054] Wed, 03 February 2016 08:51 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
Registered: March 2010
Senior Member
A disabled poller may be the problem, but I don't think it's likely because the poller is enabled by default.

I assume you don't update the model in the model thread.

Only the model thread is allowed to update the model.

This was true for Mars and is still true for Neon.
So if you do some work in a worker thread, you have to synchronize with the model thread again.

Jobs.schedule(new IRunnable() {

  @Override
  public void run() throws Exception {
    // load data here (e.g. call a service)

    ModelJobs.schedule(new IRunnable() {

      @Override
      public void run() throws Exception {
        // do model stuff here (e.g. replace rows in a table)
      }

    }, ModelJobs.newInput(ClientRunContexts.copyCurrent()));
  }
}, Jobs.newInput().withRunContext(ClientRunContexts.copyCurrent()));
Re: [Neon] Client polling [message #1722182 is a reply to message #1722171] Wed, 03 February 2016 09:32 Go to previous message
Nejc Gasper is currently offline Nejc GasperFriend
Messages: 55
Registered: July 2014
Member
Ok the second solution works, I remember hearing about the ModelJobs but totally forgot, thanks for the info.

The first post also looks interesting, I will want to investigate the polling sometime in the future I think.

Thanks!
Previous Topic:[Neon] Naming convention & demo App
Next Topic:[NEON] m5 new UI HTML testing
Goto Forum:
  


Current Time: Thu Apr 25 15:23:50 GMT 2024

Powered by FUDForum. Page generated in 0.03821 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top