- How to?
- Defining an automatic data refresh
- Use conditions
From version 26
, this feature is kept for backward compatibility.
Browsers do not always support Server-sent events (SSE).
This feature can still be used if you master the browsers used, in a secure intranet for example, and if it suits the needs of the site.In the case of a public site, timer browsers should be used.
In a dynamic WEBDEV site, the page data is refreshed during a user action.
In some cases, it may be necessary to refresh some information found in this page, without any user intervention: for example, a counter of incoming emails or a stock level. Multiple methods are available:
- Use a browser timer to refresh the page or call a server procedure in Ajax.
- Use the option for automatic refresh of the page. This mechanism is based on the "Server-sent events" technology (SSE). This technology allows the session (server side) to initiate the transmission of data toward the browser once the initial connection is implemented.
Defining an automatic data refresh
To define an automatic data refresh in a page:
- Open the desired page in the page editor.
- Open the page description window: on the "Page" tab, in the "Description" group, click "Description".
- In the "General" tab, check "Update data from server to browser every " and specify the refresh period (in seconds).
- Display the events associated with the page (F2 on the page for example).
- Two new events are available:
Remark: If the even"Refreshing the page data (server code)" returns True (RESULT True), the browser code is run (default case). Otherwise, the browser code will not be run.
- Refreshing the page data (server code): This event is run when the page is refreshed. It is used for example to refresh the desired controls: filling a list, ... This is an Ajax event.
- After refreshing the page data (browser code): This event is run after the event "Refreshing the page data (server code)". It is used to perform an additional process on the browser.
Caution: In order for the refresh code to be run, the specified refresh period must be less than the timeout for site lifetime.
Reminder: The lifetime of the session corresponds to the parameter "Disconnect the idle users since..." specified in the administrator of the WEBDEV application server ("Configuration" tab).
This option is available for the dynamic WEBDEV sites developed in HTML5 and operating on the following types of browsers:
- Google Chrome: All versions
- Mozilla Firefox: From Firefox 6.0
- Opera: From Opera 11
- Safari: From Safari 5.0
- Internet Explorer: Not supported (including IE 11)
- Edge: Not supported