AjaxRefreshManager ajaxMgr = AjaxRefreshManager.lookup();
List panelIdsToRefresh = ajaxMgr.getPanelIdsToRefresh();
panelIdsToRefresh.clear();
// Inspect all the dashboard's panels.
Panel currentPanel = RequestContext.lookup().getActivePanel();
for (Panel panel : getSection().getPanels()) {
// Leave out non dashboard related panels.
PanelDriver driver = panel.getProvider().getDriver();
if (!(driver instanceof DashboardDriver)) {
continue;
}
// Don't refresh the active panel as it's being updated already along the execution of this request.
Long panelId = panel.getPanelId();
if (currentPanel != null && currentPanel.getPanelId().equals(panelId)) {
continue;
}
// Don't refresh panels that are not displaying any dashboard data.
Set<DataProvider> providersUsed = ((DashboardDriver) driver).getDataProvidersUsed(panel);
if (providersUsed.isEmpty()) {