ConverterImplTag always wrap with DelegateConverter 
----------------------------------------------------

                 Key: MYFACES-2343
                 URL: https://issues.apache.org/jira/browse/MYFACES-2343
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-252
    Affects Versions: 1.2.7
         Environment: jsp
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe


The method createConverter says this

    protected Converter createConverter() throws JspException
    {
        if (_converterId != null && _converterId.isLiteralText())
        {
            this.createClassicConverter();
        }
        if (_converterIdString != null){
            this.createClassicConverter();
        }
        
        return new DelegateConverter(_converterId, _binding,
                _converterIdString);
    }

There are two missing return statements. This causes DelegateConverter is 
always used, and it should be used only when converterId is not literal or 
binding property is set:

<f:converter binding="#{mybean}"/>
<f:converter converterId="#{'anyid'}" binding="#{mybean}"/>

The code should be like this:

    protected Converter createConverter() throws JspException
    {
        if (_converterId != null && _converterId.isLiteralText())
        {
            return this.createClassicConverter();
        }
        if (_converterIdString != null){
            return this.createClassicConverter();
        }
        
        return new DelegateConverter(_converterId, _binding,
                _converterIdString);
    }

The effect of this behavior is that a custom converter for t:inputCalendar that 
extends from HtmlCalendarRenderer.DateConverter cannot be set when using 
myfaces core 1.2.7. 



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to