Wednesday, May 14, 2014

Display a Severe/Error/Warning/Info messages in ADF

To display Fatal Error Message
addFacesMessage(FacesMessage.SEVERITY_FATAL, "User Message");

To display Error Message
addFacesMessage(FacesMessage.SEVERITY_ERROR, "User Message"");

To display Warning Message
addFacesMessage(FacesMessage.SEVERITY_WARN, "User Message"");

To display Info Message
addFacesMessage(FacesMessage.SEVERITY_INFO, "User Message"");

// The method that displays the message.
public static void addFacesMessage(FacesMessage.Severity severity, String message) {
    FacesMessage fm = new FacesMessage(severity, message, null);
    FacesContext.getCurrentInstance().addMessage(null, fm);
}

No comments:

Post a Comment