You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Eric Torti <er...@gmail.com> on 2011/08/11 16:50:20 UTC

Missing ValueEncoder for java.util.Calendar

Hello, guys!

I have a beaneditform that's used to create and update instances of one of
the models on my app. When it's used to create and persist the instaces I
have no problem. But when it comes to editing them as on
domain.com/project/somebean/edit/10, instead of rendereing the form with the
loaded properties, the page displays an error regarding the absence of a
value encoder for java.util.Calendar.

Naturally, the bean I'm trying to update has a Calendar property.

Do I have to provide a value encoder for Calendar, or am I missing something
on the configuration of the project? I've searched around the docs but
didn't quite get it.

I could provide source if you find it to be appropriate.

Thanks,

Eric Torti

Re: Missing ValueEncoder for java.util.Calendar

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 11 Aug 2011 15:48:55 -0300, Eric Torti <er...@gmail.com> wrote:

> Hi, Thiago,

Hi! :)

> I'm tackling the construction of a Calendar Value Enconder and, as you've
> said it, the javadocs are pretty much it :]

;)

> I didn't get though how do I address localization issues. For example, if
> the String received as a parameter for the toValue(...) method and it is
> formatted according to pt_BR the month will be in place of the day  
> regarding the default behavior as localized by en_US.
> Is it the best approach to implement the value encoder to address  
> Strings as en_US formatted?

I guess so.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Missing ValueEncoder for java.util.Calendar

Posted by Eric Torti <er...@gmail.com>.
Hi, Thiago,

I'm tackling the construction of a Calendar Value Enconder and, as you've
said it, the javadocs are pretty much it :]

I didn't get though how do I address localization issues. For example, if
the String received as a parameter for the toValue(...) method and it is
formatted according to pt_BR the month will be in place of the day regarding
the default behavior as localized by en_US.

Is it the best approach to implement the value encoder to address Strings as
en_US formatted?

Thanks again,

Eric Torti

On Thu, Aug 11, 2011 at 2:28 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Thu, 11 Aug 2011 12:45:16 -0300, Eric Torti <er...@gmail.com>
> wrote:
>
>  Thank you, Thiago!
>>
>
> You're welcome!
>
>
>  Normally I prefer to use Calendar, so I'll try to provide a value encoder
>> for that type on my project. Do you know of any implementation for that or
>> something similar? I've googled it with no success :]
>>
>
> Just read the ValueEncoder JavaDoc implementation. That's everything you
> need.
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Missing ValueEncoder for java.util.Calendar

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 11 Aug 2011 12:45:16 -0300, Eric Torti <er...@gmail.com> wrote:

> Thank you, Thiago!

You're welcome!

> Normally I prefer to use Calendar, so I'll try to provide a value encoder
> for that type on my project. Do you know of any implementation for that  
> or something similar? I've googled it with no success :]

Just read the ValueEncoder JavaDoc implementation. That's everything you  
need.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Missing ValueEncoder for java.util.Calendar

Posted by Eric Torti <er...@gmail.com>.
Thank you, Thiago!

Normally I prefer to use Calendar, so I'll try to provide a value encoder
for that type on my project. Do you know of any implementation for that or
something similar? I've googled it with no success :]

On Thu, Aug 11, 2011 at 12:36 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Thu, 11 Aug 2011 11:50:20 -0300, Eric Torti <er...@gmail.com>
> wrote:
>
>  Hello, guys!
>>
>
> Hi!
>
>
>  Do I have to provide a value encoder for Calendar, or am I missing
>> something on the configuration of the project? I've searched around the docs
>> but
>> didn't quite get it.
>>
>
> As far as I know having editable class fields with Calendar type is quite
> rare (java.util.Date used instead), so that's probably why Tapestry doesn't
> provide a ValueEncoder for it out-of-the-box..
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Missing ValueEncoder for java.util.Calendar

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 11 Aug 2011 11:50:20 -0300, Eric Torti <er...@gmail.com> wrote:

> Hello, guys!

Hi!

> Do I have to provide a value encoder for Calendar, or am I missing  
> something on the configuration of the project? I've searched around the  
> docs but
> didn't quite get it.

As far as I know having editable class fields with Calendar type is quite  
rare (java.util.Date used instead), so that's probably why Tapestry  
doesn't provide a ValueEncoder for it out-of-the-box..

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org