use of org.apache.wicket.feedback.FeedbackMessage in project openmeetings by apache.
the class AbstractWicketTester method checkErrors.
public static void checkErrors(WicketTester tester, int count) {
List<FeedbackMessage> errors = getErrors(tester);
if (count != errors.size()) {
for (FeedbackMessage fm : errors) {
log.debug("Error {}", fm);
}
}
assertEquals(String.format("There should be exactly %s errors", count), count, errors.size());
}
use of org.apache.wicket.feedback.FeedbackMessage in project midpoint by Evolveum.
the class RunReportPopupPanel method initLayout.
protected void initLayout() {
Form<?> mainForm = new MidpointForm<>(ID_MAIN_FORM);
add(mainForm);
FeedbackAlerts feedback = new FeedbackAlerts(ID_POPUP_FEEDBACK);
ReportObjectsListPanel table = new ReportObjectsListPanel(ID_TABLE, getModel()) {
private final boolean checkViewAfterInitialize = true;
@Override
public Component getFeedbackPanel() {
return feedback;
}
@Override
protected boolean checkViewAfterInitialize() {
if (checkViewAfterInitialize) {
return true;
}
return super.checkViewAfterInitialize();
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
feedback.setFilter(new ComponentFeedbackMessageFilter(table) {
private static final long serialVersionUID = 1L;
@Override
public boolean accept(FeedbackMessage message) {
return true;
}
});
feedback.setOutputMarkupId(true);
mainForm.add(feedback);
AjaxSubmitButton runButton = new AjaxSubmitButton(ID_RUN_BUTTON, createStringResource("runReportPopupContent.button.run")) {
private static final long serialVersionUID = 1L;
@Override
protected void onError(AjaxRequestTarget target) {
FeedbackAlerts feedback = (FeedbackAlerts) getForm().get(ID_POPUP_FEEDBACK);
target.add(feedback);
}
@Override
protected void onSubmit(AjaxRequestTarget target) {
runConfirmPerformed(target);
}
};
runButton.setOutputMarkupId(true);
runButton.add(new VisibleBehaviour(() -> isRunnable));
mainForm.add(runButton);
AjaxButton cancelButton = new AjaxButton(ID_CANCEL_BUTTON, createStringResource("userBrowserDialog.button.cancelButton")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
getPageBase().hideMainPopup(target);
}
};
cancelButton.setOutputMarkupId(true);
mainForm.add(cancelButton);
}
use of org.apache.wicket.feedback.FeedbackMessage in project midpoint by Evolveum.
the class PageBase method onBeforeRender.
@Override
protected void onBeforeRender() {
super.onBeforeRender();
FeedbackMessages messages = getSession().getFeedbackMessages();
for (FeedbackMessage message : messages) {
getFeedbackMessages().add(message);
}
getSession().getFeedbackMessages().clear();
}
use of org.apache.wicket.feedback.FeedbackMessage in project midpoint by Evolveum.
the class ValidationErrorPanel method initHeader.
private void initHeader(WebMarkupContainer box) {
WebMarkupContainer iconType = new WebMarkupContainer("iconType");
iconType.setOutputMarkupId(true);
iconType.add(new AttributeAppender("class", new IModel() {
@Override
public Object getObject() {
FeedbackMessage result = getModelObject();
if (result == null) {
return " fa-info";
}
switch(result.getLevel()) {
case FeedbackMessage.INFO:
case FeedbackMessage.DEBUG:
return " fa-info";
case FeedbackMessage.SUCCESS:
return " fa-check";
case FeedbackMessage.ERROR:
case FeedbackMessage.FATAL:
return " fa-ban";
case FeedbackMessage.UNDEFINED:
// TODO:
case FeedbackMessage.WARNING:
default:
return " fa-warning";
}
}
}));
box.add(iconType);
Label message = new Label(ID_MESSAGE, new PropertyModel<Serializable>(getModel(), "message"));
box.add(message);
AjaxLink<Void> close = new AjaxLink<Void>("close") {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
close(target);
}
};
box.add(close);
}
Aggregations