You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Jing Wu (JIRA)" <de...@myfaces.apache.org> on 2010/11/24 01:12:39 UTC

[jira] Updated: (TRINIDAD-1963) Handle empty string pattern in NumberConverter

     [ https://issues.apache.org/jira/browse/TRINIDAD-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jing Wu updated TRINIDAD-1963:
------------------------------

    Status: Patch Available  (was: Open)

> Handle empty string pattern in NumberConverter
> ----------------------------------------------
>
>                 Key: TRINIDAD-1963
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1963
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0.3-core
>         Environment: environment independent
>            Reporter: Jing Wu
>         Attachments: numconverter.patch
>
>
> "pattern" attribute of convertNumber component is defined of type String, thus if this attribute is bound to an EL expression, the value will be evaluated to an empty string if no value is obtained from that expression. Example: (here format property of Empno in bindings is not defined, thus null, the the whole expression is evaluated to be an empty string because the type is String)
>     <af:inputText value="#{bindings.Empno.inputValue}" label="#{bindings.Empno.hints.label}"
>                   required="#{bindings.Empno.hints.mandatory}"
>                   columns="#{bindings.Empno.hints.displayWidth}"
>                   maximumLength="#{bindings.Empno.hints.precision}"
>                   shortDesc="#{bindings.Empno.hints.tooltip}" id="it4">
>       <f:validator binding="#{bindings.Empno.validator}"/>
>       <af:attributeDragSource attribute="value"/>
>       <af:convertNumber groupingUsed="false" pattern="#{bindings.Empno.format}"/>
>     </af:inputText>
> Empty string of pattern causes all sorts of undesired behavior, we need to override getPattern() method on NumberConverter so that empty string is treated as null.

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