You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Matthias Wessendorf <ma...@apache.org> on 2008/11/21 17:21:20 UTC

Re: Trinidad : date validation

On Fri, Nov 21, 2008 at 4:59 PM, Naik, Bhushan <bh...@citi.com> wrote:
>  Hi,
>        I want to use Trinidad where in need to restrict user to enter
> any date that is less than (Currentdate + 7 days), the trinidad tag I am
> using is "tr:inputDate".
> I know  in javascript we can do this but how to do this in  Trinidad?

This provides the "range":
http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateDateTimeRange.html

and to be more fancy, you can use this:
http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateDateRestriction.html

-Matthias

> Please suggest.
>
> Thanks
> Bhushan
>
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

RE: Trinidad : date validation

Posted by "Naik, Bhushan " <bh...@citi.com>.
 Thanks Matthias.

 It works , I tried with binding with TagUtils and also I tried with
"<tr:validateDateTimeRange" it works.




-----Original Message-----
From: Matthias Wessendorf [mailto:mwessendorf@gmail.com] 
Sent: Saturday, November 22, 2008 1:59 AM
To: MyFaces Development
Subject: Re: Trinidad : date validation

See the doc el type(in your bean) is date not string.

Sent from my iPod.

Am 21.11.2008 um 22:43 schrieb "Naik, Bhushan " <bh...@citi.com>:

> I am getting error "java.lang.IllegalArgumentException: Cannot convert
> 2008-11-28 of type class java.lang.String to class java.util.Date" ?
>
> Code I have is
> <tr:inputDate id="depDate1" label="Date1:" autoSubmit="true"
> valueChangeListener="#{jsfTestTab1DataBean.valueChangedDate}"
> value="#{jsfTestTab1DataBean.date1}">
>
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
>
> <tr:validateDateTimeRange  minimum="2008-11-28"  maximum="2009-12-21"
>
> messageDetailNotInRange='Date "{1}" in "{0}" not within minimum {2} 
> and maximum range {3}'/>
>
> </tr:inputDate>
>
>
> -----Original Message-----
> From: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com] On Behalf 
> Of Matthias Wessendorf
> Sent: Friday, November 21, 2008 4:32 PM
> To: MyFaces Development
> Subject: Re: Trinidad : date validation
>
> On Fri, Nov 21, 2008 at 10:25 PM, Naik, Bhushan 
> <bh...@citi.com>
> wrote:
>> Thanks  Matthias , Can we select the dynamic dates for  max and min 
>> value. I am setting this dates in the bean #{Mybean.maxdate}  but its

>> not working.
>
> sure that works.
> see the doc for more:
> http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateDate
> Ti
> meRange.html
>
>>
>> Thanks
>> Bhushan
>>
>> -----Original Message-----
>> From: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com] On Behalf 
>> Of Matthias Wessendorf
>> Sent: Friday, November 21, 2008 11:21 AM
>> To: MyFaces Development
>> Subject: Re: Trinidad : date validation
>>
>> On Fri, Nov 21, 2008 at 4:59 PM, Naik, Bhushan 
>> <bh...@citi.com>
>> wrote:
>>> Hi,
>>>       I want to use Trinidad where in need to restrict user to enter
>
>>> any date that is less than (Currentdate + 7 days), the trinidad tag 
>>> I
>
>>> am using is "tr:inputDate".
>>> I know  in javascript we can do this but how to do this in   
>>> Trinidad?
>>
>> This provides the "range":
>> http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/
>> tr_validateDate
>> Ti
>> meRange.html
>>
>> and to be more fancy, you can use this:
>> http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/
>> tr_validateDate
>> Re
>> striction.html
>>
>> -Matthias
>>
>>> Please suggest.
>>>
>>> Thanks
>>> Bhushan
>>>
>>>
>>
>>
>>
>> --
>> Matthias Wessendorf
>>
>> blog: http://matthiaswessendorf.wordpress.com/
>> sessions: http://www.slideshare.net/mwessendorf
>> twitter: http://twitter.com/mwessendorf
>>
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf

Re: Trinidad : date validation

Posted by Matthias Wessendorf <mw...@gmail.com>.
See the doc el type(in your bean) is date not string.

Sent from my iPod.

Am 21.11.2008 um 22:43 schrieb "Naik, Bhushan " <bh...@citi.com>:

> I am getting error "java.lang.IllegalArgumentException: Cannot convert
> 2008-11-28 of type class java.lang.String to class java.util.Date" ?
>
> Code I have is
> <tr:inputDate id="depDate1" label="Date1:" autoSubmit="true"
> valueChangeListener="#{jsfTestTab1DataBean.valueChangedDate}"
> value="#{jsfTestTab1DataBean.date1}">
>
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
>
> <tr:validateDateTimeRange  minimum="2008-11-28"  maximum="2009-12-21"
>
> messageDetailNotInRange='Date "{1}" in "{0}" not within minimum {2}  
> and
> maximum range {3}'/>
>
> </tr:inputDate>
>
>
> -----Original Message-----
> From: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com] On Behalf  
> Of
> Matthias Wessendorf
> Sent: Friday, November 21, 2008 4:32 PM
> To: MyFaces Development
> Subject: Re: Trinidad : date validation
>
> On Fri, Nov 21, 2008 at 10:25 PM, Naik, Bhushan  
> <bh...@citi.com>
> wrote:
>> Thanks  Matthias , Can we select the dynamic dates for  max and min
>> value. I am setting this dates in the bean #{Mybean.maxdate}  but its
>> not working.
>
> sure that works.
> see the doc for more:
> http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateDateTi
> meRange.html
>
>>
>> Thanks
>> Bhushan
>>
>> -----Original Message-----
>> From: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com] On Behalf
>> Of Matthias Wessendorf
>> Sent: Friday, November 21, 2008 11:21 AM
>> To: MyFaces Development
>> Subject: Re: Trinidad : date validation
>>
>> On Fri, Nov 21, 2008 at 4:59 PM, Naik, Bhushan  
>> <bh...@citi.com>
>> wrote:
>>> Hi,
>>>       I want to use Trinidad where in need to restrict user to enter
>
>>> any date that is less than (Currentdate + 7 days), the trinidad  
>>> tag I
>
>>> am using is "tr:inputDate".
>>> I know  in javascript we can do this but how to do this in   
>>> Trinidad?
>>
>> This provides the "range":
>> http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/ 
>> tr_validateDate
>> Ti
>> meRange.html
>>
>> and to be more fancy, you can use this:
>> http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/ 
>> tr_validateDate
>> Re
>> striction.html
>>
>> -Matthias
>>
>>> Please suggest.
>>>
>>> Thanks
>>> Bhushan
>>>
>>>
>>
>>
>>
>> --
>> Matthias Wessendorf
>>
>> blog: http://matthiaswessendorf.wordpress.com/
>> sessions: http://www.slideshare.net/mwessendorf
>> twitter: http://twitter.com/mwessendorf
>>
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf

RE: Trinidad : date validation

Posted by "Naik, Bhushan " <bh...@citi.com>.
I am getting error "java.lang.IllegalArgumentException: Cannot convert
2008-11-28 of type class java.lang.String to class java.util.Date" ?

Code I have is 
<tr:inputDate id="depDate1" label="Date1:" autoSubmit="true"
valueChangeListener="#{jsfTestTab1DataBean.valueChangedDate}"
value="#{jsfTestTab1DataBean.date1}">
	
<tr:convertDateTime pattern="yyyy-MM-dd"/>
	
<tr:validateDateTimeRange  minimum="2008-11-28"  maximum="2009-12-21" 
	
messageDetailNotInRange='Date "{1}" in "{0}" not within minimum {2} and
maximum range {3}'/>
	
</tr:inputDate>


-----Original Message-----
From: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com] On Behalf Of
Matthias Wessendorf
Sent: Friday, November 21, 2008 4:32 PM
To: MyFaces Development
Subject: Re: Trinidad : date validation

On Fri, Nov 21, 2008 at 10:25 PM, Naik, Bhushan <bh...@citi.com>
wrote:
> Thanks  Matthias , Can we select the dynamic dates for  max and min 
> value. I am setting this dates in the bean #{Mybean.maxdate}  but its 
> not working.

sure that works.
see the doc for more:
http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateDateTi
meRange.html

>
> Thanks
> Bhushan
>
> -----Original Message-----
> From: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com] On Behalf 
> Of Matthias Wessendorf
> Sent: Friday, November 21, 2008 11:21 AM
> To: MyFaces Development
> Subject: Re: Trinidad : date validation
>
> On Fri, Nov 21, 2008 at 4:59 PM, Naik, Bhushan <bh...@citi.com>
> wrote:
>>  Hi,
>>        I want to use Trinidad where in need to restrict user to enter

>> any date that is less than (Currentdate + 7 days), the trinidad tag I

>> am using is "tr:inputDate".
>> I know  in javascript we can do this but how to do this in  Trinidad?
>
> This provides the "range":
> http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateDate
> Ti
> meRange.html
>
> and to be more fancy, you can use this:
> http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateDate
> Re
> striction.html
>
> -Matthias
>
>> Please suggest.
>>
>> Thanks
>> Bhushan
>>
>>
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>



--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Re: Trinidad : date validation

Posted by Matthias Wessendorf <ma...@apache.org>.
On Fri, Nov 21, 2008 at 10:25 PM, Naik, Bhushan <bh...@citi.com> wrote:
> Thanks  Matthias , Can we select the dynamic dates for  max and min
> value. I am setting this dates in the bean #{Mybean.maxdate}  but its
> not working.

sure that works.
see the doc for more:
http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateDateTimeRange.html

>
> Thanks
> Bhushan
>
> -----Original Message-----
> From: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com] On Behalf Of
> Matthias Wessendorf
> Sent: Friday, November 21, 2008 11:21 AM
> To: MyFaces Development
> Subject: Re: Trinidad : date validation
>
> On Fri, Nov 21, 2008 at 4:59 PM, Naik, Bhushan <bh...@citi.com>
> wrote:
>>  Hi,
>>        I want to use Trinidad where in need to restrict user to enter
>> any date that is less than (Currentdate + 7 days), the trinidad tag I
>> am using is "tr:inputDate".
>> I know  in javascript we can do this but how to do this in  Trinidad?
>
> This provides the "range":
> http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateDateTi
> meRange.html
>
> and to be more fancy, you can use this:
> http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateDateRe
> striction.html
>
> -Matthias
>
>> Please suggest.
>>
>> Thanks
>> Bhushan
>>
>>
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

RE: Trinidad : date validation

Posted by "Naik, Bhushan " <bh...@citi.com>.
Thanks  Matthias , Can we select the dynamic dates for  max and min
value. I am setting this dates in the bean #{Mybean.maxdate}  but its
not working.

Thanks
Bhushan

-----Original Message-----
From: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com] On Behalf Of
Matthias Wessendorf
Sent: Friday, November 21, 2008 11:21 AM
To: MyFaces Development
Subject: Re: Trinidad : date validation

On Fri, Nov 21, 2008 at 4:59 PM, Naik, Bhushan <bh...@citi.com>
wrote:
>  Hi,
>        I want to use Trinidad where in need to restrict user to enter 
> any date that is less than (Currentdate + 7 days), the trinidad tag I 
> am using is "tr:inputDate".
> I know  in javascript we can do this but how to do this in  Trinidad?

This provides the "range":
http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateDateTi
meRange.html

and to be more fancy, you can use this:
http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_validateDateRe
striction.html

-Matthias

> Please suggest.
>
> Thanks
> Bhushan
>
>



--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf