use of com.evolveum.midpoint.gui.api.component.result.OperationResultPanel in project midpoint by Evolveum.
the class TaskResultTabPanel method initLayout.
private void initLayout(final IModel<TaskDto> taskDtoModel, final PageBase pageBase) {
SortableDataProvider<OperationResult, String> provider = new ListDataProvider<>(this, new PropertyModel<List<OperationResult>>(taskDtoModel, TaskDto.F_OP_RESULT));
TablePanel resultTablePanel = new TablePanel<>(ID_OPERATION_RESULT, provider, initResultColumns());
resultTablePanel.setStyle("padding-top: 0px;");
resultTablePanel.setShowPaging(false);
resultTablePanel.setOutputMarkupId(true);
add(resultTablePanel);
add(new AjaxFallbackLink(ID_SHOW_RESULT) {
public void onClick(AjaxRequestTarget target) {
OperationResult opResult = taskDtoModel.getObject().getTaskOperationResult();
OperationResultPanel body = new OperationResultPanel(pageBase.getMainPopupBodyId(), new Model<>(OpResult.getOpResult(pageBase, opResult)), pageBase);
body.setOutputMarkupId(true);
pageBase.showMainPopup(body, target);
}
});
}
use of com.evolveum.midpoint.gui.api.component.result.OperationResultPanel in project midpoint by Evolveum.
the class FeedbackListView method populateItem.
@Override
protected void populateItem(final ListItem<FeedbackMessage> item) {
final FeedbackMessage message = item.getModelObject();
if (message.getMessage() instanceof OpResult) {
final OpResult opResult = (OpResult) message.getMessage();
OperationResultPanel panel = new OperationResultPanel("message", Model.of(opResult)) {
private static final long serialVersionUID = 1L;
@Override
public void close(AjaxRequestTarget target) {
super.close(target);
message.markRendered();
}
protected void onAfterRender() {
opResult.setAlreadyShown(true);
super.onAfterRender();
}
};
panel.add(new VisibleBehaviour(() -> opResult != null && !opResult.isAlreadyShown()));
panel.setOutputMarkupId(true);
item.add(panel);
} else {
message.markRendered();
ValidationErrorPanel validationPanel = new ValidationErrorPanel("message", item.getModel()) {
private static final long serialVersionUID = 1L;
@Override
public void close(AjaxRequestTarget target) {
super.close(target);
message.markRendered();
}
};
validationPanel.setOutputMarkupId(true);
item.add(validationPanel);
}
}
use of com.evolveum.midpoint.gui.api.component.result.OperationResultPanel in project midpoint by Evolveum.
the class TestConnectionMessagesPanel method initResultsPanel.
public void initResultsPanel(RepeatingView resultView, List<OpResult> opresults, Page parentPage) {
for (OpResult result : opresults) {
OperationResultPanel resultPanel = new OperationResultPanel(resultView.newChildId(), new Model<>(result));
resultPanel.add(new VisibleBehaviour(() -> result != null));
resultPanel.setOutputMarkupId(true);
resultView.add(resultPanel);
}
}
use of com.evolveum.midpoint.gui.api.component.result.OperationResultPanel 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