Package javax.faces.application

Examples of javax.faces.application.FacesMessage


                            String formattedMessage = formatMessage(msg, locale, label, convertedValue); // create Summary
                                                                                                         // message ?
                            String summary = getSummary();
                            String formattedSummary = Strings.isNullOrEmpty(summary) ? formattedMessage : formatMessage(
                                summary, locale, label, convertedValue);
                            context.addMessage(component.getClientId(context), new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                formattedSummary, formattedMessage));
                        }
                    }
                }
            } catch (ELException e) {
View Full Code Here


            }
            Set<ConstraintDescriptor<?>> constraints = propertyConstraints // or the requested list of groups)
                .getConstraintDescriptors();

            // ContextHolder is an arbitrary object, it will depend on the implementation
            FacesMessage message = Strings.isNullOrEmpty(msg) ? null : new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
            return processConstraints(context, constraints, message);
        } else {
            return Collections.emptySet();
        }
    }
View Full Code Here

        for (ConstraintDescriptor<?> cd : constraints) {
            Annotation a = cd.getAnnotation();
            Map<String, Object> parameters = cd.getAttributes();
            // TODO if cd.isReportedAsSingleConstraint() make sure than only the root constraint raises an error message
            // if one or several of the composing constraints are invalid)
            FacesMessage message = null == msg ? validatorFactory.interpolateMessage(context, cd) : msg;
            Class<? extends Annotation> validatorClass = findAnnotationClass(a);
            BeanValidatorDescriptor beanValidatorDescriptor = new BeanValidatorDescriptor(validatorClass, message);
            for (Map.Entry<String, Object> entry : parameters.entrySet()) {
                String key = entry.getKey();
                if (!HIDDEN_PARAMS.contains(key)) {
View Full Code Here

                context.renderResponse();
                // send all validation messages.
                String clientId = getClientId(context);
                for (String msg : messages) {
                    String summary = null != getSummary() ? getSummary() : msg;
                    context.addMessage(clientId, new FacesMessage(FacesMessage.SEVERITY_ERROR, summary, msg));
                }
            }
        }
    }
View Full Code Here

                public ConstraintDescriptor<?> getConstraintDescriptor() {
                    return constrain;
                }
            }, MessageFactory.getCurrentLocale(context));
            return new FacesMessage(interpolatedMessage);
        } else {
            return MessageFactory.createMessage(context, UIInput.UPDATE_MESSAGE_ID);
        }
    }
View Full Code Here

     * javax.faces.convert.Converter)
     */
    public ConverterDescriptor getConverterDescription(FacesContext context, EditableValueHolder input, Converter converter,
        String converterMessage) {
        // determine converter message.
        FacesMessage message = getMessage(context, converter, input, converterMessage);
        ConverterDescriptorImpl descriptor = new ConverterDescriptorImpl(converter.getClass(), message);
        fillParameters(descriptor, converter);
        descriptor.makeImmutable();
        return descriptor;
    }
View Full Code Here

     * @see org.richfaces.validator.FacesValidatorService#getValidatorDescription(javax.faces.context.FacesContext,
     * javax.faces.validator.Validator)
     */
    public ValidatorDescriptor getValidatorDescription(FacesContext context, EditableValueHolder input, Validator validator,
        String validatorMessage) {
        FacesMessage message = getMessage(context, validator, input, validatorMessage);
        FacesValidatorDescriptor descriptor = new FacesValidatorDescriptor(validator.getClass(), message);
        setLabelParameter(input, descriptor);
        fillParameters(descriptor, validator);
        descriptor.makeImmutable();
        return descriptor;
View Full Code Here

                UIComponent form = getNestingForm(component);
                return form;
            }
        }
        facesContext.addMessage(null, new FacesMessage("The form wasn't detected for the request",
                "The form wasn't detected for the request - rendering does not have to behave well"));
        return null;
    }
View Full Code Here

         apprChainRef.setFinalcomplete(finalComplete);
         apprChainRef.setFinalapproved(finalApprFK);
        
         apprHandler.persistApprovalChain(apprChainRef);
                
        FacesContext.getCurrentInstance().addMessage("userTop", new FacesMessage(FacesMessage.SEVERITY_INFO, "Success", "Application Created"));
        return "applicationHome";
    }
View Full Code Here

        itinRef.setTravelday(tempTravelDay);

        quoteRef.setCostcenter(costCentre);

        appHandler.persistApplicationEdit(appRef, quoteRef, itinRef, travelRef);
        FacesContext.getCurrentInstance().addMessage("submitAppConfirm", new FacesMessage(FacesMessage.SEVERITY_INFO, "Success", "Changes have been saved"));
        return "/applicationView.xhtml";
    }
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.