Package javax.faces.context

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


          + " isn't available!");
      message.setSeverity(FacesMessage.SEVERITY_ERROR);

      FacesContext context = FacesContext.getCurrentInstance();
     
      context.addMessage(tree.getBaseClientId(context), message);
    }
   
    tree.setRowKey(oldRowKey);
  }
 
View Full Code Here


                                                 messageStr,
                                                 messageStr);
                  }
                 
                  context.getExternalContext().log(message.getSummary(), result);
                  context.addMessage(getClientId(context), message);
                  context.renderResponse();
              } catch (IllegalArgumentException e) {
                  FacesMessage message =
                    MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID, new Object[] {
                          MessageUtil.getLabel(context, this)
View Full Code Here

                    MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID, new Object[] {
                          MessageUtil.getLabel(context, this)
                        });
                 
                  context.getExternalContext().log(message.getSummary(), e);
                  context.addMessage(getClientId(context), message);
                  context.renderResponse();
              } catch (Exception e) {
                  FacesMessage message =
                    MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID, new Object[] {
                          MessageUtil.getLabel(context, this)
View Full Code Here

                    MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID, new Object[] {
                          MessageUtil.getLabel(context, this)
                        });

                  context.getExternalContext().log(message.getSummary(), e);
                  context.addMessage(getClientId(context), message);
                  context.renderResponse();
              }
          }
      }
    }
View Full Code Here

          setValid(false);
          String messageString = e.toString();
          e.printStackTrace();
          FacesMessage message = new FacesMessage(messageString);
          message.setSeverity(FacesMessage.SEVERITY_ERROR);
          facesContext.addMessage(getClientId(facesContext),
              message);
          facesContext.renderResponse();
        }
      } else {
        super.broadcast(event);
View Full Code Here

        // XXX add message
        FacesMessage message = new FacesMessage(
            "preloadDateRangeBegin is greater than preloadDateRangeEnd");
        message.setSeverity(FacesMessage.SEVERITY_ERROR);
        FacesContext context = FacesContext.getCurrentInstance();
        context.addMessage(getClientId(context), message);
        throw new IllegalArgumentException();
      }

      List <Date> dates = new ArrayList<Date>();
View Full Code Here

            if(ExtValUtils.executeAfterThrowingInterceptors(
                    entryOfTarget.getComponent(), entryOfTarget.getMetaDataEntry(),
                    entryOfTarget.getConvertedObject(), validatorException, this))
            {
                facesContext.addMessage(entryOfTarget.getClientId(),
                        ExtValUtils.convertFacesMessage(validatorException.getFacesMessage()));
            }
        }
    }
View Full Code Here

  public String checkDates() {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    if (validityEnd.before(validityStart)) {
      String message = "End date before start date.";
      facesContext.addMessage("page:validityEnd",
          new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
    }
    return "messages";
  }
View Full Code Here

        } catch (FacesException e) {
          LOG.error("", e);
          FacesContext facesContext = facesContextFactory.getFacesContext(context, request, response, lifecycle);
          // TODO  better Message i18n Message?
          FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getCause().getMessage(), null);
          facesContext.addMessage(null, facesMessage);
          facesContext.renderResponse();
          return facesContext;
        }
      }
    }
View Full Code Here

  @Before
  public void setUp() throws Exception {
    super.setUp();
    FacesContext facesContext = getFacesContext();
    facesContext.addMessage("id0", new FacesMessage(FacesMessage.SEVERITY_INFO, "test", "a test"));
    facesContext.addMessage("id0", new FacesMessage(FacesMessage.SEVERITY_WARN, "test", "a test"));
    facesContext.addMessage("id1", new FacesMessage(FacesMessage.SEVERITY_ERROR, "test", "a test"));
    facesContext.addMessage("id1", new FacesMessage(FacesMessage.SEVERITY_FATAL, "test", "a test"));
    facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "test", "a test"));
  }
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.