thx ben - i've committed it.

regards,
gerhard

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



2010/10/27 <neum...@ijet.com>

>  This null-check was also needed in the Bean Validation version.
>
> Thanks!
> Ben
>
> -----Original Message-----
> *From:* Ben Neuman
> *Sent:* Wednesday, October 27, 2010 11:31 AM
> *To:* 'MyFaces Development'
> *Subject:* NPE in Required Initialization for labels addon (property
> version)
>
> I had to make a small change in the Required Initialization for labels
> (property version) to resolve a NullPointerException.
>
> In DefaultRequiredLabelInitializer I added a null value check. Without, I
> was getting NullPointerExceptions.
>
> protected void applyRequiredMarker(FacesContext facesContext, UIOutput
> uiOutput)
> {
>     ValueExpression expression = uiOutput.getValueExpression("value");
>
>         if (expression != null)
>         {
>             applyRequiredMarkerUsingExpression(facesContext, uiOutput,
> expression.getExpressionString());
>         }
>         else
>         {
>             String value = (String) uiOutput.getValue();
>             if (value != null) {
>                 applyRequiredMarkerUsingValue(facesContext, uiOutput,
> value);
>             }
>         }
>         ...
> }
>
> Thanks!
> Ben
>
>

Reply via email to