cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Larson <...@keow.org>
Subject Re: CForms : fd:case for union widget ?
Date Tue, 02 Nov 2004 04:36:09 GMT
On Mon, Nov 01, 2004 at 11:19:15PM +0100, Joerg Heinicke wrote:
> On 01.11.2004 09:20, Sylvain Wallez wrote:
> 
> >>I'd like to know if a fd:case for the union widget is still planned to 
> >>give more flexibility than the fd:struct or if there is another way to 
> >>give a matching expression to the fd:struct.
> >
> >There were discussions about this [1] which unfortunately have stalled. 
> >IIRC, using an expression for cases was considered to bring too much 
> >overhead, as it expressions would need to be computed for each request. 
> >Additional flexibility can be achieved though by having the union's case 
> >widget be an output whose value is computed, eventually reacting to 
> >change to other widget values.
> 
> When I talked the last time with Tim about it (yes I think it was just 
> Time and me) we agreed that the missing fd:case causes just troubles. It 
> was not about an additional expression, but about needing fd:struct, 
> which results in needing ft:struct and fb:struct - where you need 
> ft:case and fb:case anyway. Furthermore the inconsequence is just 
> irritating.

Yes there are two issues here, parallel structure between the binding,
model, and template (binding and template use *:case, model does not,)
and allowing cases to specify their own conditions rather than being
simple cases like in a switch statement.

For the first issue (parallel structure), we should add fd:case to the
form model for consistency's sake, to simplify learning the union/
choose concept.

As for the second issue (conditions on cases), it should be an option.
This way you can have the choice of fast switch-like behaviour versus
slower if...elseif...elseif...else behaviour depending on your needs.

--Tim Larson

Mime
View raw message