Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Problem with notification
Problem with notification [message #1705586] Mon, 17 August 2015 15:52 Go to next message
Karel Haruda is currently offline Karel HarudaFriend
Messages: 22
Registered: March 2014
Junior Member
Hi,
I have problem with notifications. I want to notify all other running clients when any client change data.
how it works .... Client change data and send it to server, next server generate notification using
SERVICES.getService(IClientNotificationService.class).putNotification(notification, new AllUserFilter(120000L));



on client page (AbstractPageWithTable<Table>) i have this code to register and handle notification
  protected void execInitPage() throws ProcessingException {
     super.execInitPage();
     SERVICES.getService(IClientNotificationConsumerService.class).addGlobalClientNotificationConsumerListener(new IClientNotificationConsumerListener() {
          @Override
          public void handleEvent(ClientNotificationConsumerEvent e, boolean sync) {
            e.consume();
            reloadPage();
          }
     }
  }


handleEvent is called after server putNotification but reloadPage cause exception "IllegalStateException" "queueing swt runnable from outside scout thread". Does anybody know where is the problem and how to fix it ??

thanks for answers ..

K.
Re: Problem with notification [message #1705742 is a reply to message #1705586] Tue, 18 August 2015 17:37 Go to previous messageGo to next message
Matthias Zimmermann is currently offline Matthias ZimmermannFriend
Messages: 208
Registered: June 2015
Senior Member
hi karel

I suspect that in your example you try to directly modify the state of the user interface outside of Scout's UI thread. Please try to change your code in a way that you have a separate consumer service in the scout client. This consumer service can then schedule changes to the state of the user interface using Scout jobs as demonstrated in the notification consumer service [1] of Scout's chat application example.

Hope this helps.
Matthias

[1] https://github.com/BSI-Business-Systems-Integration-AG/org.eclipsescout.demo/blob/5.0/bahbah/org.eclipsescout.demo.bahbah.client/src/org/eclipsescout/demo/bahbah/client/services/BahBahNotificationConsumerService.java
Re: Problem with notification [message #1705779 is a reply to message #1705742] Wed, 19 August 2015 07:06 Go to previous message
Karel Haruda is currently offline Karel HarudaFriend
Messages: 22
Registered: March 2014
Junior Member
Yes,
thank you very much .. I was almost in finish because I tried create ClientAsyncJob in handle response but it did not work .. solution was near ... make ClientAsyncJob and in runVoid make ClientSyncJob and in his runVoid work with UI Smile

this solution work fine .. thx ..

Karel.
Previous Topic:Web Site Like Behaviour thru Scout
Next Topic:[Blog Post] Gerrit inline editing Feature
Goto Forum:
  


Current Time: Sat Apr 27 02:04:33 GMT 2024

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

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

Back to the top