Example usage for org.apache.wicket.markup.html.form ValidationErrorFeedback getMessage

List of usage examples for org.apache.wicket.markup.html.form ValidationErrorFeedback getMessage

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.form ValidationErrorFeedback getMessage.

Prototype

public Serializable getMessage()

    

Source Link

Document

Gets message.

Usage

From source file:gr.abiss.calipso.wicket.CalipsoFeedbackMessageFilter.java

License:Open Source License

public boolean accept(FeedbackMessage fm) {
    String message = null;/* ww  w. j  av  a 2s.c om*/
    // wicket bit too flexible, wicket internally created errors are not just Strings
    // but if you added an error using the error(String) signature - will be just String
    Object fmMessage = fm.getMessage();
    if (fmMessage instanceof String) {
        message = (String) fmMessage;
    } else {
        ValidationErrorFeedback error = (ValidationErrorFeedback) fm.getMessage();
        message = error.getMessage();
    }
    if (!this.previous.contains(message)) {
        this.previous.add(message);
        return true;
    }
    return false;
}

From source file:info.jtrac.wicket.JtracFeedbackMessageFilter.java

License:Apache License

public boolean accept(FeedbackMessage fm) {
    String message = null;//  w  ww.  j a  va 2  s. c  o  m
    // wicket bit too flexible, wicket internally created errors are not just Strings
    // but if you added an error using the error(String) signature - will be just String
    if (fm.getMessage() instanceof String) {
        message = (String) fm.getMessage();
    } else {
        ValidationErrorFeedback error = (ValidationErrorFeedback) fm.getMessage();
        message = error.getMessage();
    }
    if (!previous.contains(message)) {
        previous.add(message);
        return true;
    }
    return false;
}

From source file:org.devproof.portal.core.module.common.component.ValidationDisplayBehaviour.java

License:Apache License

private String getFeedbackMessage(FormComponent<?> component) {
    FeedbackMessage feedbackMessage = component.getFeedbackMessage();
    if ((feedbackMessage != null) && (feedbackMessage.getLevel() >= FeedbackMessage.ERROR)) {
        feedbackMessage.markRendered();/*from w  ww  .  j a va 2  s .c o  m*/
        if (feedbackMessage.getMessage() instanceof ValidationErrorFeedback) {
            ValidationErrorFeedback error = (ValidationErrorFeedback) feedbackMessage.getMessage();
            return error.getMessage();
        } else {
            return (String) feedbackMessage.getMessage();
        }
    }
    return null;
}