Ronan Keane
Ronan Keane

Reputation: 189

How to auto-refresh a screen in Moqui?

Use case is a regularly updated display of vehicle tracking data retrieved through a REST call, onto a central office screen, with no user interaction.

Upvotes: 0

Views: 106

Answers (1)

David E. Jones
David E. Jones

Reputation: 1776

There is no single answer for this, but some alternatives to consider:

  1. add some JavaScript to your screen that uses the JS setTimeout() method or something similar to reload the page
  2. for a smoother result but a lot more effort write the section of the screen that needs to auto-update as a Vue component and use the standard websocket interface to send data to the browser to update the data in the HTML; this is generally best done using the NotificationMessage interfaces and methods in the Moqui API where the JavaScript client registers on a topic and gets a notification along with any others registered (structure the topic ID as needed to differentiate different feeds) and have a scheduled service job feed the notification topic

Upvotes: 2

Related Questions