Skip to content

Commit

Permalink
rn
Browse files Browse the repository at this point in the history
  • Loading branch information
francois authored and francois committed Jan 30, 2025
1 parent 710165e commit ef20d0f
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion content/CTG_99_versions/CTG_10_release-notes/LSN_90_v6-3/v6-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,34 @@ Deprecated features to be removed in the next releases <span id="deprecation"></
Core changes <span id="changes"></span>
---------------------------------------

- Nothing so far...
- Server side event: new servlet `/ui/sse` (asynchronous) to push messages from server to clients thru https

Example to bind a `myEvent` message:

1) Server side:

```java
ServerSideEvent.push("myEvent", new JSONObject().put("info","hello"), userId);
```

userId: null to notify all registered clients or a specific user.

2) Client side: simply add an event listener on `ui.ready`

```javascript
$ui.sse.addEventListener("myEvent", e => {
let d = JSON.parse(e.data);
console.log("myEvent message: " + d.info + " at time = " + d.time);
});
```

- Predefined server side events (work in progress)
- `ping`: simple ping thru SSE
- `close`: close the SSE connection
- `reset`: reopen the SSE connection
- `sysparam`: new system parameter flag to push changes from `grant.setParameter("MYPARAM","value")` to client in `$ui.sysparams.MYPARAM="value"`
- `objparam`: push an object parameter to UI in `obj.locals.MYPARAM`
- `enumCounters`: refresh counters in menu when enum or status has changed during save

UI changes <span id="uichanges"></span>
---------------------------------------
Expand Down

0 comments on commit ef20d0f

Please sign in to comment.