[Seaside-dev] nested form handling

Julian Fitzell jfitzell at gmail.com
Mon Oct 6 18:26:19 UTC 2008


On Mon, Oct 6, 2008 at 8:04 PM, Randal L. Schwartz
<merlyn at stonehenge.com> wrote:
>
> Can the form tag be made smarter so that if it is used within an outer form,
> it just turns into a div?  I'm thinking that I would like to be able to
> include arbitrary components inside my components that have forms, and if the
> "nested form prevention" was built into the form tag, I wouldn't have to
> override to built it myself. :)
>
> It needs to be a div (or maybe span - is a form tag normally block or inline?)
> because it has to be able to be id'ed and class'ed like a normal form.  The
> only thing this would break is anyone who thought that only a portion of
> values would be submitted, or anyone who is literally calling "form" in their
> styles as opposed to a class or id.

Have you seen WAFormDecoration. I haven't used it myself but I see it
was added at some point and presumably is intended to partly address
this issue. Lukas or Philippe may have a better idea. It looks like
the idea would be to *never* include the form in your components and
just add the decoration wherever you actually wanted a form to show
up.

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).

Julian


More information about the seaside-dev mailing list