use of com.evolveum.midpoint.web.component.refresh.AutoRefreshDto in project midpoint by Evolveum.
the class PageTaskEdit method initLayout.
protected void initLayout() {
refreshModel = new Model(new AutoRefreshDto());
refreshModel.getObject().setInterval(getRefreshInterval());
IModel<PrismObject<TaskType>> prismObjectModel = new AbstractReadOnlyModel<PrismObject<TaskType>>() {
@Override
public PrismObject<TaskType> getObject() {
return objectWrapperModel.getObject().getObject();
}
};
final TaskSummaryPanel summaryPanel = new TaskSummaryPanel(ID_SUMMARY_PANEL, prismObjectModel, refreshModel, this);
summaryPanel.setOutputMarkupId(true);
add(summaryPanel);
mainPanel = new TaskMainPanel(ID_MAIN_PANEL, objectWrapperModel, taskDtoModel, showAdvancedFeaturesModel, this);
mainPanel.setOutputMarkupId(true);
add(mainPanel);
summaryPanel.getRefreshPanel().startRefreshing(this, null);
}
use of com.evolveum.midpoint.web.component.refresh.AutoRefreshDto in project midpoint by Evolveum.
the class PageTaskEdit method refresh.
public void refresh(AjaxRequestTarget target) {
TaskTabsVisibility tabsVisibilityOld = new TaskTabsVisibility();
tabsVisibilityOld.computeAll(this);
TaskButtonsVisibility buttonsVisibilityOld = new TaskButtonsVisibility();
buttonsVisibilityOld.computeAll(this);
refreshTaskModels();
TaskTabsVisibility tabsVisibilityNew = new TaskTabsVisibility();
tabsVisibilityNew.computeAll(this);
TaskButtonsVisibility buttonsVisibilityNew = new TaskButtonsVisibility();
buttonsVisibilityNew.computeAll(this);
if (!buttonsVisibilityNew.equals(buttonsVisibilityOld)) {
target.add(mainPanel.getButtonPanel());
}
if (tabsVisibilityNew.equals(tabsVisibilityOld)) {
// soft version
for (Component component : mainPanel.getTabPanel()) {
if (component instanceof TaskTabPanel) {
for (Component c : ((TaskTabPanel) component).getComponentsToUpdate()) {
target.add(c);
}
}
}
} else {
// hard version
target.add(mainPanel.getTabPanel());
}
target.add(getSummaryPanel());
AutoRefreshDto refreshDto = refreshModel.getObject();
refreshDto.recordRefreshed();
if (isEdit() || !refreshDto.isEnabled()) {
getRefreshPanel().stopRefreshing(this, target);
} else {
getRefreshPanel().startRefreshing(this, target);
}
}
Aggregations