[ 
https://issues.jboss.org/browse/JBSEAM-4163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marek Novotny closed JBSEAM-4163.
---------------------------------

    Resolution: Rejected

    
> Nullpointerexception from s:selectItems when noSelectionLabel is present and 
> converter of selectOneMenu evaluates to null
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBSEAM-4163
>                 URL: https://issues.jboss.org/browse/JBSEAM-4163
>             Project: Seam 2
>          Issue Type: Bug
>          Components: JSF Integration
>    Affects Versions: 2.1.1.GA
>            Reporter: Jakub Janczak
>
> The problem is that when you have the noSelectionLabel in s:selectItems it 
> installs a converter chain in the h:selectOneMenu.
> <h:selectOneMenu converter="#{conv}" .... >
>    <s:selectItems noSelectionLabel="#{messages['noSelectionLabel']}" />
> </h:selectOneMenu>
> So when the #{conv} evaluates to null it  blows. The problem is in the 
> PrioritizableConverter as it has the constructor:
> public PrioritizableConverter(ValueExpression vb, int priority)
>    {
>       this.valueExpression = vb;
>       this.priority = priority;
>    }
> and then
> public String getAsString(FacesContext context, UIComponent component, Object 
> value)
>             throws ConverterException
>    {
>       return getDelegate().getAsString(context, component, value);
>    }
> public Converter getDelegate()
>    {
>       if (valueExpression != null)
>       {
>          return (Converter) 
> valueExpression.getValue(FacesContext.getCurrentInstance().getELContext());
>       }
>       else
>       {
>          return delegate;
>       }
>    }
> so if getDelegate returns null it's not able to convert.
> The solution would be to disable adding the PrioritizableConverter to the 
> chain when the #{conv} evaluates to null (ConverterChain.java : 73)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
seam-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/seam-issues

Reply via email to