myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefano Panero" <stefano.pan...@gmail.com>
Subject Using Label value in custom validator
Date Mon, 04 Jun 2007 10:35:54 GMT
Hi everybody,

I've implemented a simple custum validator

    public void validate(FacesContext context, UIComponent component, Object
value) throws ValidatorException {
        List errors =  validate(value); // do some validation logic

        if (!errors.isEmpty()) {

                FacesMessage message = new FacesMessage();
                message.setDetail("LABEL_NEEDED...");
                message.setSummary("Some summary text"));
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                throw new ValidatorException(message);
            }
        }

    }

How can I create the FacesMessage using the t:outputLabel value instead of
the ID in the detail part?
In other words: how can I get label from input component?

Mime
View raw message