Re: DateBox parseStrict
Thanks you Thomas!!
It works but only in the first setter of the widget. When the blur
event occurs the function used to parse the date is other and it is
not strict. Any more idea??
Thank you!!
On 12 sep, 14:07, Thomas Broyer <t.bro...@gmail.com> wrote:
> AFAICT, all you need is implement your own DateBox.Format, possibly
> extending DateBox.DefaultFormat, and set it on the DateBox (either passing
> it to the constructor, or using setFormat).
>
> Something like:
> class MyFormat extends DefaultFormat {
> @Override
> public Date parse(DateBox dateBox, String dateText, boolean reportError) {
> Date date = null;
> try {
> if (!dateText.isEmpty()) {
> date = getDateTimeFormat().parseStrict(dateText);
> }
> } catch (IllegalArgumentException iae) {
> if (reportError) {
> dateBox.addStyleName("dateBoxFormatError");
> }
> }
> return date;
> }
>
>
>
>
>
>
>
> }
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home