On Fri, Mar 05, 2004 at 06:44:47PM +0100, Stefan Klein wrote:
> Hi,
> 
> I thought I'd give this a second try, since I didn't get any replies the
> first time round. I'd appreciate any kind of comment/suggestion. Thanks!
>  
> Just wondering whether anyone has got any thoughts on this/best practices
> to offer: 
>  
> I have got a woody form that I need to display in very slight variations,
> e.g. a certain button 
> should only be visible under certain conditions that I can check in my
> flow. 
>  
> The options I can see are: 
> 1. Have several form templates, one for each variation. Don't like that
> very much, too much 
> duplication. 
> 2. Send a request parameter to the formpipeline. Assign an extra
> attribute "req-param" to the 
> optional elements <wt:widget id="optionalbutton"
> filter:req-param="optionalbutton"/>. Then 
> write a transform that checks for the "req-param" attribute and filters
> the corresponding element 
> if no request parameter by that name is given. 
> 3. Use jxtemplate generator to generate the formtemplate and use the
> context object to pass a 
> value that determines whether to display a certain element or not. Inside
> the jxtemplate I'd 
> enclose the element in an if-statement. 

4. Use a "union" widget and "union" template.  I do not know if the
union template was ported to jxtemplate, but it works with the woody
transformer.  Docs: http://wiki.cocoondev.org/Wiki.jsp?page=TimLarson
Eventually the "union" construct will be replaced with a "choice"
construct, docs: http://wiki.cocoondev.org/Wiki.jsp?page=WoodyScratchpad
"Choice" has not been implemented yet, so this is a very good time to
comment on the design to make sure it will fit your needs.

--Tim Larson

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to