|
Re: client notification [message #727258 is a reply to message #727232] |
Tue, 20 September 2011 18:25 |
Arthur vD Messages: 52 Registered: March 2010 |
Member |
|
|
Hi
You have to call: CODES.reloadCodeType(MyCodeType.class);
If you're interested in the details of how this triggers a client notification, you can look at the class CodeTypeChangedNotification and at CodeTypeStore.unloadCodeTypeCache() where SERVICES.getService(IClientNotificationService.class).putNotification(new CodeTypeChangedNotification(types), new AllUserFilter(120000L)); is called.
Edit: Ah, yes, what Ivan says below: Turn on client notifications at ClientSession.execLoadSession().
[Updated on: Tue, 20 September 2011 19:13] Report message to a moderator
|
|
|
|
|
|
|
|
Re: client notification [message #732172 is a reply to message #728722] |
Tue, 04 October 2011 06:39 |
Daniel Wiehl Messages: 1 Registered: May 2016 |
Junior Member |
|
|
The most easiest way to get your page refreshed is to register a data-changed listener on the page. To to so, register the listener in execInitPage by calling registerDataChangeListener(xy). Thereby, xy is the type of data you are interested in receiving update notifications for. Typically, this is an enum represententing e.g. entities. For instance, that would be EntityEnum.Company or EntityEnum.Person.
Furthermore, you have to write the consumer to handle client notifications you are interested in. That is done as mentioned above by SERVICES.getService(IClientNotificationConsumerService.class).addGlobalClientNotificationConsumerListener(new IClientNotificationConsumerListener() { .. }
In handleEvent of that listener, you simply call ClientSession.get().getDesktop().dataChanged(EntityEnum.Company) unless the notification is not of interest for that data. In turn, the page gets updated automatically without calling reloadPage() manually.
I hope that helped.
[Updated on: Tue, 04 October 2011 06:40] by Moderator Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.07200 seconds