use of com.evolveum.midpoint.web.component.util.SelectableListDataProvider in project midpoint by Evolveum.
the class TaskResultTabPanel method initLayout.
private void initLayout() {
IModel<List<OperationResult>> resultModel = new ReadOnlyModel<>(() -> createOperationResultList());
SelectableListDataProvider<SelectableBean<OperationResult>, OperationResult> provider = new SelectableListDataProvider<>(this, resultModel);
BoxedTablePanel<SelectableBean<OperationResult>> resultTablePanel = new BoxedTablePanel<>(ID_OPERATION_RESULT, provider, initResultColumns());
resultTablePanel.setOutputMarkupId(true);
add(resultTablePanel);
AjaxFallbackLink<Void> showResult = new AjaxFallbackLink<Void>(ID_SHOW_RESULT) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(Optional<AjaxRequestTarget> optionalTarget) {
if (!optionalTarget.isPresent()) {
LOGGER.warn("Cannot show result in interactive way, request target not present.");
return;
}
AjaxRequestTarget target = optionalTarget.get();
PrismObjectWrapper<TaskType> taskWrapper = TaskResultTabPanel.this.getModelObject();
TaskType taskType = taskWrapper.getObject().asObjectable();
OperationResult opResult = OperationResult.createOperationResult(taskType.getResult());
OpResult result = opResult != null ? OpResult.getOpResult(getPageBase(), opResult) : null;
OperationResultPanel body = new OperationResultPanel(getPageBase().getMainPopupBodyId(), new Model<>(result));
body.add(new VisibleBehaviour(() -> opResult != null));
body.setOutputMarkupId(true);
getPageBase().showMainPopup(body, target);
}
};
showResult.setOutputMarkupId(true);
add(showResult);
}
Aggregations