use of com.evolveum.midpoint.gui.api.component.result.ValidationErrorPanel 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);
}
}
Aggregations