use of io.jmix.dashboardsui.event.DashboardUpdatedEvent in project jmix by jmix-framework.
the class DashboardImpl method initTimer.
private void initTimer(Component frame) {
Window parentWindow = findWindow(frame);
int timerDelay = getTimerDelay() == 0 ? dashboardModel.getTimerDelay() : getTimerDelay();
if (timerDelay > 0 && parentWindow != null) {
Timer dashboardUpdatedTimer = facets.create(Timer.class);
dashboardUpdatedTimer.setOwner(getFrame());
dashboardUpdatedTimer.setDelay(timerDelay * 1000);
dashboardUpdatedTimer.setRepeating(true);
dashboardUpdatedTimer.addTimerActionListener(timer -> uiEventPublisher.publishEvent(new DashboardUpdatedEvent(dashboardModel)));
dashboardUpdatedTimer.start();
}
}
use of io.jmix.dashboardsui.event.DashboardUpdatedEvent in project jmix by jmix-framework.
the class PersistentDashboardEdit method onPropagateBtnClick.
@Subscribe("propagateBtn")
public void onPropagateBtnClick(Button.ClickEvent event) {
DashboardModel dashboard = getDashboardModel();
uiEventPublisher.publishEvent(new DashboardUpdatedEvent(dashboard));
}
Aggregations