Package javax.faces.context

Examples of javax.faces.context.FacesContext.addMessage()


    private ActionListener actionListener = new BoundActionListener();

    private static void addFacesMessage(String messageText) {
        FacesContext context = FacesContext.getCurrentInstance();
        context.addMessage(null, new FacesMessage(messageText));
    }

    public void handleActionMethod(ActionEvent event) throws AbortProcessingException {
        addFacesMessage("Method expression listener called");
    }
View Full Code Here


            UIComponent component = RendererUtils.getInstance().findComponentFor(currentComponent, componentId);

            if (component == null) {
                String message = FocusManager.class.getSimpleName() + ": Component with ID '" + componentId + "' was not found";
                LOG.warn(message);
                context.addMessage(null, new FacesMessage(message));
            } else {
                String clientId = component.getClientId(context);

                setContextAttribute(context, clientId);
View Full Code Here

    private ActionListener actionListener = new BoundActionListener();

    private static void addFacesMessage(String messageText) {
        FacesContext context = FacesContext.getCurrentInstance();
        context.addMessage(null, new FacesMessage(messageText));
    }

    public void handleActionMethod(ActionEvent event) throws AbortProcessingException {
        addFacesMessage("Method expression listener called");
    }
View Full Code Here

@RequestScoped
public class MessageBean {

    public void generateMessages() {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        facesContext.addMessage("form:escaped", new FacesMessage("the html <b>is escaped</b>"));
        facesContext.addMessage("form:unescaped", new FacesMessage("the html <b>is not escaped</b>"));
        facesContext.addMessage(null, new FacesMessage("A <a href='http://richfaces.org'>RichFaces</a> global message <b>with html</b>"));
    }
}
View Full Code Here

public class MessageBean {

    public void generateMessages() {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        facesContext.addMessage("form:escaped", new FacesMessage("the html <b>is escaped</b>"));
        facesContext.addMessage("form:unescaped", new FacesMessage("the html <b>is not escaped</b>"));
        facesContext.addMessage(null, new FacesMessage("A <a href='http://richfaces.org'>RichFaces</a> global message <b>with html</b>"));
    }
}
View Full Code Here

    public void generateMessages() {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        facesContext.addMessage("form:escaped", new FacesMessage("the html <b>is escaped</b>"));
        facesContext.addMessage("form:unescaped", new FacesMessage("the html <b>is not escaped</b>"));
        facesContext.addMessage(null, new FacesMessage("A <a href='http://richfaces.org'>RichFaces</a> global message <b>with html</b>"));
    }
}
View Full Code Here

     * @param message the message
     */
    private void addInfo(String message) {
        FacesContext context = FacesUtil.getFacesContext();

        context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,
            message, null));
    }

    /**
     * Add warning message to the message
View Full Code Here

     * @param message the message
     */
    private void addWarn(String message) {
        FacesContext context = FacesUtil.getFacesContext();

        context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN,
            message, null));
    }

    /**
     * Add error message to the UI
View Full Code Here

     * @param message the message
     */
    private void addError(String message) {
        FacesContext context = FacesUtil.getFacesContext();

        context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR,
            message, null));
    }

    /**
     * Add fatal message to the UI
View Full Code Here

     * @param message the message
     */
    private void addFatal(String message) {
        FacesContext context = FacesUtil.getFacesContext();

        context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL,
            message, null));
    }

    /**
     * Create status message by message string and level
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.