[Seaside-dev] nested form handling

Lukas Renggli renggli at gmail.com
Mon Oct 6 19:16:28 UTC 2008


>  I obviously see the desire to have it "just work" but I also feel like
>  it is hard to define an automatic behaviour that isn't surprising in
>  some cases. It might be less surprising to add an #ensureForm: method
>  to the Canvas that would have the optional behaviour (though how easy
>  it is to implement when each component has its own canvas, I'm not
>  sure).

Check the mailing list archive for several discussions on this topic.

Silently pruning nested form tags only works in most basic cases. In a
well designed application, the extent of a form is usually chosen
carefully to define what fields are submitted. Moreover design and
scripts might depend on such a tag. I believe that there is something
wrong with the design of your app, if you run into nested forms.

- If you really don't care about forms at all (which is very hard to
believe), why not just render a form around the root component? Like
this you always have a form and just avoid rendering other forms.

- If you want to make them magically disappear you can create your own
WAFormTag subclass. In the #with: method you check for a specific
dynamic variable: if set, you simply render the argument; if not set,
you set it and call super. Again, this is not something I would
consider good practice.

Cheers,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the seaside-dev mailing list