incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Wessendorf" <mat...@apache.org>
Subject Re: Custom messages for converters
Date Wed, 24 Jan 2007 14:17:49 GMT
<tr:inputText label="test">
  <tr:convertDateTime
   type="both"
   messageDetailConvertBoth="Well,the value ({1}) is not really in a
propper format, like {2}"
  />
</tr:inputText>

works for me w/ latest trinidad (check the trunk)

the messageDetailConvertBoth works, only when type is both and pattern not set
(means don't provide the pattern attr)

have u tried to override

org.apache.myfaces.trinidad.convert.DateTimeConverter.CONVERT_BOTH_detail

?


regarding "convertBothMessageDetail" we changed them during october 2006
(tracked in Jira)

-M

On 1/24/07, magdolna holitska <mholitska3@hotmail.com> wrote:
> Hello Matthias,
>
> Thank you so much for responding.
>
> In the Trinidad documentation and demo source I have seen the attribute
> messageDetailConvertBoth, but interestingly, it didn't seem to do anything
> for me ...
>
> However, convertBothMessageDetail (found in adf documentation) did work:
>         <tr:inputText id="firstDate">
>             <tr:convertDateTime type="both" convertBothMessageDetail="Well,
> the value ({1}) is not really in a propper format, like {2}"/>
>         </tr:inputText>
>
> The problem is, that if I add the attribute pattern (pattern="MMM-dd-yyyy
> HH:mm:ss") the custom message stops working.
>
> If you look at the trinidad api, they even specify in the description for
> the attribute messageDetailConvertBoth:
> "... when type is set to 'both' and pattern is not set or is null"
> (http://incubator.apache.org/adffaces/trinidad-api/tagdoc/tr_convertDateTime.html)
>
> Is there a way to have both pattern as well as customized messages?
>
> Thank you,
> Magdolna
>
>
>
>
> >From: "Matthias Wessendorf" <matzew@apache.org>
> >Reply-To: adffaces-user@incubator.apache.org
> >To: adffaces-user@incubator.apache.org
> >Subject: Re: Custom messages for converters
> >Date: Wed, 24 Jan 2007 09:50:32 +0100
> >
> >note that the type is by default "date"
> >
> >you need to do something like
> >
> ><tr:convertDateTime type="both" messageDetailConvertBoth="Well, the
> >value ({1}) is not really in a propper format, like {2}"/>
> >
> >
> >
> >
> >On 1/24/07, Matthias Wessendorf <matzew@apache.org> wrote:
> >>On 1/24/07, magdolna holitska <mholitska3@hotmail.com> wrote:
> >> > Hi all,
> >> >
> >> > I have been trying, unsuccessfully to customize the error messages
> >>generated
> >> > by a date/time converter (tr:convertDateTime).
> >> >
> >> > - I tried to add the message id to my resources file
> >> > (org.apache.myfaces.trinidad.convert.DateTimeConverter.CONVERT_BOTH)
> >>
> >>_detail
> >>
> >>
> >> > - I tried to use the attribute convertBothMessageDetail
> >>
> >>attributes renamed to
> >>
> >>-messageDetailConvertBoth
> >>-messageDetailConvertDate
> >>-messageDetailConvertTime
> >>
> >>
> >> > - I tried to create my own converter class by extending Trinidad
> >>converter
> >> > and use the setConvertBothMessageDetail method to set the custom
> >>message
> >> >
> >> > It appears that it only works if I don't set the pattern.
> >> > As soon as I am setting the pattern I get a default validation text
> >>(The
> >> > value "xxx" is not a valid date. Valid example: "Nov-29-2005
> >>15:45:24".)
> >> >
> >> > Validator messages seem to be easily customizable, but not converters.
> >> > Could please someone point out what I am missing here?
> >> >
> >> > Thank you,
> >> > Magdolna
> >> >
> >> > _________________________________________________________________
> >> > Windows Live Spaces: share your New Year pictures!
> >> > http://discoverspaces.live.com/?loc=en-CA
> >> >
> >> >
> >>
> >>
> >>--
> >>Matthias Wessendorf
> >>http://tinyurl.com/fmywh
> >>
> >>further stuff:
> >>blog: http://jroller.com/page/mwessendorf
> >>mail: mwessendorf-at-gmail-dot-com
> >>
> >
> >
> >--
> >Matthias Wessendorf
> >http://tinyurl.com/fmywh
> >
> >further stuff:
> >blog: http://jroller.com/page/mwessendorf
> >mail: mwessendorf-at-gmail-dot-com
>
> _________________________________________________________________
> Your Space. Your Friends. Your Stories. Share your world with Windows Live
> Spaces. http://discoverspaces.live.com/?loc=en-CA
>
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Mime
View raw message