You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dan Adams <da...@ifactory.com> on 2007/06/28 20:33:54 UTC

[T5] Configurable value encoders for select?

Select has hard-coded support for Enums and then defaults to strings.
Could we introduce a service that would allow registering values
encoders by type? I just hit a situation where I had to register an
encoder because my options were a list of booleans. Could also be useful
for lists of hibernate entities.

-- 
Dan Adams
Senior Software Engineer
Interactive Factory
617.235.5857


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


Re: [T5] Configurable value encoders for select?

Posted by Nick Westgate <ni...@key-planning.co.jp>.
It's a bit inconvenient to have to add ValueEncoders for all the basic
wrapper types that are often in domain objects (Boolean, Integer etc.)
Howard's previous comment about translators applies here too:

"It does make sense that there should be a default translator that
leverages the TypeCoercer to perform translations to and from strings"

In fact I've added a JIRA issue:
https://issues.apache.org/jira/browse/TAPESTRY-1598

There's also a bug in automatic List to SelectModel conversion:
https://issues.apache.org/jira/browse/TAPESTRY-1597

Cheers,
Nick.


Howard Lewis Ship wrote:
> This is in 5.0.5, it's a new service called ValueEncoderSource. You
> can map types to a ValueEncoderFactory implementation.
> 
> On 6/28/07, Dan Adams <da...@ifactory.com> wrote:
>> Select has hard-coded support for Enums and then defaults to strings.
>> Could we introduce a service that would allow registering values
>> encoders by type? I just hit a situation where I had to register an
>> encoder because my options were a list of booleans. Could also be useful
>> for lists of hibernate entities.
>>
>> -- 
>> Dan Adams
>> Senior Software Engineer
>> Interactive Factory
>> 617.235.5857
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 

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


Re: [T5] Configurable value encoders for select?

Posted by Howard Lewis Ship <hl...@gmail.com>.
This is in 5.0.5, it's a new service called ValueEncoderSource. You
can map types to a ValueEncoderFactory implementation.

On 6/28/07, Dan Adams <da...@ifactory.com> wrote:
> Select has hard-coded support for Enums and then defaults to strings.
> Could we introduce a service that would allow registering values
> encoders by type? I just hit a situation where I had to register an
> encoder because my options were a list of booleans. Could also be useful
> for lists of hibernate entities.
>
> --
> Dan Adams
> Senior Software Engineer
> Interactive Factory
> 617.235.5857
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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