AutoRefreshMenu.RefreshTimer

Syntax

RefreshTimer: function(sender, args);

Parameters

sender. Event source.

args. Event information.

Description

The RefreshTimer event is generated on working periodic refresh timer.

Example

To execute the example, the HTML page must contain the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component). Add handlers of the RefreshTimer and RefreshStateChanged events, fire the events:

// Get report autoupdate menu by steps
ribbonView = expressBox.getRibbonView();
control = ribbonView.getControl();
auReMenuControl = control.getControlById("MainAutoRefreshButton");
autoRefreshMenu = auReMenuControl.getMenu();
// Handle the RefreshStateChanged event
autoRefreshMenu.RefreshStateChanged.add(function (sender, args) { console.log("Autoupdate status is changed") });
// Handle the RefreshTimer event
autoRefreshMenu.RefreshTimer.add(function (sender, args) { console.log("Periodic refresh timer worked") });
// Set periodic refresh parameters - refresh each 2 seconds
autoRefreshMenu.setPeriod(2, PP.Mb.TimeUnits.Seconds);
// Disable autoupdate on selection change
autoRefreshMenu.setMarkChangedRefresh(false);
// -> Autoupdate status is changed
// Start periodic refresh timer
autoRefreshMenu.startPeriodicalTimer();
// -> Periodic refresh timer worked
// Disable periodic refresh timer
autoRefreshMenu.stopPeriodicalTimer();

After executing the example the RefreshTimer and RefreshStateChanged event handlers are added. Periodic refresh timer is set up, autoupdate is disabled on selection change. The events are fired, the console window displays the messages "Autoupdate state is changed" and "Periodic refresh timer worked".

See also:

AutoRefreshMenu