[ 
https://issues.apache.org/jira/browse/TRINIDAD-2084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017073#comment-13017073
 ] 

Yee-Wah Lee commented on TRINIDAD-2084:
---------------------------------------

Before Trinidad-1898, during ConverterELTag#doStartTag(), the following would 
happen. 
        UIComponent component = tag.getComponentInstance();
        ValueHolder vh = (ValueHolder)component;
        Object localValue = vh.getLocalValue();
        if (localValue instanceof String) {
            try {
                localValue = converter.getAsObject(context, (UIComponent)vh,
(String) localValue);
                vh.setValue(localValue);
            }
Hence, the component would take the string "0.5",convert it to a number and set 
it on the component. Later, during rendering, getAsString() would take the 
numerical value and format it with the currency code. 

A new class TrinidadConverterELTag was introduced in Trinidad-1898, but it did 
not contain the same code in doStartTag. It returned after setting the 
converter on the valueHolder. 
Converter converter = createConverter();
        ((ValueHolder)component).setConverter(converter);
        return Tag.SKIP_BODY;
Subsequently, the component still has the value "0.5". During rendering, 
getAsString() simply returns that string. 

> TrinidadConverterELTag does not convert ValueHolder value during 
> initialization (regression)
> --------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-2084
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2084
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Yee-Wah Lee
>            Priority: Minor
>
> This is seen since Trinidad-1898
> 1. Create the following jspx
> <tr:inputNumberSpinbox label="Literal" id="ins1a" value="0.5">
>  <tr:convertNumber type="currency"/>
>  </tr:inputNumberSpinbox>
> 2. Run the jspx, the input displays "0.5". Prior to Trinidad-1898, it would 
> display "ยค0.50". 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to