dev@javaserverfaces.java.net

javax.faces.component.MessageFactory.getLabel(FacesContext,UIComponent)

From: Mark Collette <mark.collette_at_icesoft.com>
Date: Mon, 29 Oct 2007 12:57:14 -0600

In the method
javax.faces.component.MessageFactory.getLabel(FacesContext,UIComponent),
at the line where o = component.getValueExpression("label"), should
getLabel(-) be returning the evaluation of the ValueExpression, and not
the ValueExpression itself?


|*
<http://java.sun.com/javaee/5/docs/api/javax/el/ValueExpression.html#getValue%28javax.el.ELContext%29>*|
static Object getLabel(FacesContext context,
                                    UIComponent component) {
                                    
    Object o = component.getAttributes().get("label");
    if (o == null || (o instanceof String && ((String) o).length() == 0)) {
        o = component.getValueExpression("label");
<<<<<<<<<<<<<<<<
    }
    // Use the "clientId" if there was no label specified.
    if (o == null) {
        o = component.getClientId(context);
    }
    return o;
}


- Mark Collette