tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Zeigler <robert.zeig...@roxanemy.com>
Subject Re: Palette and Checklist don't use contributed value encoder?
Date Sat, 20 Aug 2011 22:52:48 GMT
Um... last time I checked, Grid, GridRows, and Loop all operate on lists of objects, so if
this is the argument, then the philosophy is inconsistently applied.  In fact, Grid makes
it's determination based on the "row" parameter.  And AjaxFormLoop /does/ provide a default
value encoder (iff you've also bound the "value" parameter... which is usually).  The components
take advantage of the fact that if the user has bound the value, whatever type is bound must
be universally applicable to all items in the list.

Again, AjaxFormLoop already does this.  There's no reason Palette couldn't do something like
that as well.. supply the defaultEncoder based on the bound type of the value.
I haven't looked over Checklist, but I suspect a similar case can be made there.

Robert

On Aug 20, 2011, at 8/206:54 AM , Igor Drobiazko wrote:

> Checklist, Palette and AjaxFormLoop operate on a list of objects
> (SelectModel or Iterable) while the other component take only a single
> value. Providing a default ValueEncoder would mean that you need to get the
> first element in the list and check its type. This would probably work if
> the model parameter were principal. But what if you have different types of
> objects in the list?
> 
> On Sat, Aug 20, 2011 at 3:56 AM, Bob Harner <bobharner@gmail.com> wrote:
> 
>> Does anyone know why half of the built-in Tapestry 5 components that
>> take an "encoder" parameter are NOT set up to be able to use a
>> "contributed" ValueEncoder (that is, one configured with
>> contributeValueEncoderSource() in AppModule class)?
>> 
>> The following components nicely allow the "encoder" parameter to be
>> optional:
>> 
>>   Grid, GridRows, Loop, Select, Upload:
>> 
>> But the following make you provide the encoder parameter (even if you
>> have a ValueEncoder configured in your AppModule for the appropriate
>> type):
>> 
>>   AjaxFormLoop, Palette, Checklist, Hidden, RadioGroup
>> 
>> Maybe there's some subtle reason for this?
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>> 
>> 
> 
> 
> -- 
> Best regards,
> 
> Igor Drobiazko
> http://tapestry5.de


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


Mime
View raw message