Labels are a component like anything else.

However, I suspect you'd need to iterate through the entire component
tree, looking for any h:label component that contains a reference to
the current component.

Another way to go is to use the t:message/messages component with
replaceIdWithLabel=true to perform the replacement at that time.
Actually, you could probably look at the source code for this
component to figure out how it's done as well.


On 6/4/07, Stefano Panero <[EMAIL PROTECTED]> wrote:
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?

Reply via email to