Package javax.faces.application

Examples of javax.faces.application.FacesMessage


        facesContext.addMessage(null, new FacesMessage("Toggle node: " + getNodeData() + ", source is: " + event.getSource()));
    }

    public void behaviorSelectionChangeListener(AjaxBehaviorEvent event) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        facesContext.addMessage(event.getComponent().getClientId(facesContext), new FacesMessage(
                "Selection changed, source is: " + event.getSource()));
    }
View Full Code Here


        return qunit.runScript(clientSideFunction.toScript());
    }

    private Object getErrorMessage(Validator validator) {
        FacesValidatorServiceImpl validatorService = new FacesValidatorServiceImpl();
        FacesMessage message = validatorService.getMessage(facesEnvironment.getFacesContext(), validator, input, null);
        return new Message(message);
    }
View Full Code Here

        return qunit.runScript(clientSideFunction.toScript());
    }

    private Object getErrorMessage(Converter converter) {
        ConverterServiceImpl converterService = new ConverterServiceImpl();
        FacesMessage message = converterService.getMessage(facesEnvironment.getFacesContext(), converter, input, null);
        return new Message(message);
    }
View Full Code Here

    }

    public void processClick() {
        FacesContext context = FacesContext.getCurrentInstance();

        context.addMessage(null, new FacesMessage(getPath()));
    }
View Full Code Here

      return FacesMessages.createFacesMessage( FacesMessage.SEVERITY_ERROR, invalidValues[0].getMessage() );
   }

   private FacesMessage createMessage(Throwable cause)
   {
      return new FacesMessage(FacesMessage.SEVERITY_ERROR, "model validation failed:" + cause, null);
   }
View Full Code Here

   }

   private void addRequiredMessage(FacesContext facesContext)
   {
      ResourceBundle resourceBundle = SeamResourceBundle.getBundle();
      throw new ValidatorException( new FacesMessage(
               FacesMessage.SEVERITY_ERROR,
               resourceBundle.getString("javax.faces.component.UIInput.REQUIRED"),
               null
            ) );
   }
View Full Code Here

        if (messageKey == null) {
            throw new NullPointerException("messageKey");
        }

        FacesMessage result = detectLocalesAndCreate(facesContext, MESSAGE_FACTORY, messageKey, args);

        if (result != null) {
            result.setSeverity(severity);
        }

        return result;
    }
View Full Code Here

                // convert value and check if it is in range
                value = convert(newValue);
            } catch (Exception e) {
                setValid(false);

                FacesMessage mess = new FacesMessage(label + ": " + e.getLocalizedMessage());

                mess.setSeverity(FacesMessage.SEVERITY_ERROR);
                context.addMessage(this.getClientId(context), mess);
            }

            if (value != null) {
                if ((null == minValue) || (null == maxValue)) {
                    setValid(false);

                    FacesMessage mess = new FacesMessage(label + ": conversation error, maxValue or minValue is null!");

                    mess.setSeverity(FacesMessage.SEVERITY_ERROR);
                    context.addMessage(this.getClientId(context), mess);
                } else if (minValue.doubleValue() > value.doubleValue()) {
                    setValid(false);

                    FacesMessage mess = new FacesMessage(label + ": input value is less than minimal value!");

                    mess.setSeverity(FacesMessage.SEVERITY_ERROR);
                    context.addMessage(this.getClientId(context), mess);
                } else if (maxValue.doubleValue() < value.doubleValue()) {
                    setValid(false);

                    FacesMessage mess = new FacesMessage(label + ": input value is more than maximum value!");

                    mess.setSeverity(FacesMessage.SEVERITY_ERROR);
                    context.addMessage(this.getClientId(context), mess);
                }
            } else {
                setValid(false);

                FacesMessage mess = new FacesMessage(label + ": input value can't be null!");

                mess.setSeverity(FacesMessage.SEVERITY_ERROR);
                context.addMessage(this.getClientId(context), mess);
            }
        }

        super.validateValue(context, newValue);
View Full Code Here

            private static final long serialVersionUID = 1L;

            @BeforePhase(Phase.RENDER_RESPONSE)
            public void addGlobalMessage() {
                FacesContext context = FacesContext.getCurrentInstance();
                context.addMessage(null, new FacesMessage("global message"));
            }

            @AfterPhase(Phase.RENDER_RESPONSE)
            public void verifyGlobalMessageIsIgnored() {
                FacesContext context = FacesContext.getCurrentInstance();
View Full Code Here

   }

   public void register() throws Exception {
      log.info("Registering " + newMember.getName());
      em.persist(newMember);
      facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Registered!", "Registration successful"));
      memberEventSrc.fire(newMember);
      initNewMember();
   }
View Full Code Here

TOP

Related Classes of javax.faces.application.FacesMessage

Copyright © 2018 www.massapicom. 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.