myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabrielle Crawford (JIRA)" <>
Subject [jira] Updated: (TRINIDAD-1950) Null pattern handling in DateTimeConverter is inconsistent
Date Fri, 19 Nov 2010 19:18:14 GMT


Gabrielle Crawford updated TRINIDAD-1950:

       Resolution: Fixed
    Fix Version/s: 
           Status: Resolved  (was: Patch Available)

> Null pattern handling in DateTimeConverter is inconsistent
> ----------------------------------------------------------
>                 Key: TRINIDAD-1950
>                 URL:
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions:
>         Environment: Linux x86
>            Reporter: Kentaro Kinebuchi
>            Priority: Minor
>             Fix For: 
>         Attachments: bug08927847.patch
> For null patterns, the getPattern() method in DateTimeConverter returns null in non-Facelets
and empty string in Facelets due to TRINIDAD-381. This is causing inconsistent behavior depending
on whether Facelets or non-Facelets is used. Some of the code in DateTimeConverter does attempt
to handle both null and empty string patters such as in _getDateFormat() but most of the methods
simply check if the pattern is null. It is better to modify getPattern() to always return
null when pattern is either null or empty string.
> One example of a problem this inconsistent handling of pattern is causing is that when
we have a DateTime component such as:
> <af:inputDate value="#{bindings.Hiredate.inputValue}"
>                         label="#{bindings.Hiredate.hints.label}"
>                         required="#{bindings.Hiredate.hints.mandatory}"
>                         shortDesc="#{bindings.Hiredate.hints.tooltip}" id="id1">
>             <f:validator binding="#{bindings.Hiredate.validator}"/>
>       <af:convertDateTime pattern="#{bindings.Hiredate.format}"/>
> </af:inputDate>
> And pattern is null then depending on whether we are using Facelets or non-Facelets when
the user picks a date value it ends up getting formatted differently. And it's happening because
getJSPattern() in DateTimeConverter only checks for null.

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

View raw message